×ü?á??×??üó?μ?μ?linuxD????é
1.
ê1ó?sed2?è???DD·?
]#sed 's/\(.\){n\}/\n/g' file
???D′óà¨o?à?μ?n±íê??úμún??×?·?oó2?è???DD·?
2.
?úvi??2é?′windows???t?á3???windows??DD·?^M . ê1ó?vi×?′?ì???1|?ü?′?éé?3y
°′ò???esc
ê?è?
:%s/^M//g
???D^Mê?°′ctrl+v£?ctrl+mê?è?3?à′μ??£
3.
bash±è???D
-ne 2?μè?¢-eq μèóú?¢-le D?óúμèóú?¢-lt D?óú?¢-ge ′óóúμèóú?¢-gt ′óóú£o?aD???ê?ó?óúêy×?′óD?±è??
??
==?¢£?=£o?aD?2?ê?ó?óú×?·?′?±è???£
4.
?úawk?Dòyó?shell±?á?
?òè??a×?o?μ?°ì·¨ê?
]#from_shell="hi awk"
]#awk '{print '"$from_shell“‘}'
?a?ù2?ò×3????????êìa?£
5.
?ú??±??D?ò????μ?·?£?óDê±oòDèòa°??3D??üá?μ??á1??3??±?á??μ
?éê1ó?`` ?ò??ê1ó?$()
è?
#!/bin/bash
for i in `seq 1 5`
do
echo $i
done
?ò??
#!/bin/bash
for i in $(seq 1 5)
do
echo $i
done
6.
]#sed -n '/keyword/{N;p}'
?éê?3?1??ü×?μ???ò?DD
]#grep -A 2 keyword
?éê?3?1??ü×?μ???á?DD
7.
D′???òμ¥°?±?μ??ˉèo·t???÷1üàí
′???±??ú?¨á¢D?è?1??μoó???y3£??DD
#!/bin/bash
########
#c-ssh.sh
#]#./c-ssh.sh root server-list.txt "ls -l /home"
########
if [ $# -ne 3 ]
then
echo "Usage: $0 <user> <Machine_List> <Commond_List>"
exit 1
fi
for server_list in $(cat $2)
do
ssh $1@$server_list $3
done
相关新闻>>
- 发表评论
-
- 最新评论 更多>>