Search Results

Search: Posts Made By: SaCai
8,311
Posted By SaCai
cat 1 1 2 3 [cailu@host26 ~]$ cat 2 a ...
cat 1
1
2
3
[cailu@host26 ~]$ cat 2
a
b
c
[cailu@host26 ~]$ while read -u3 A && read -u4 B;do echo $A;echo $B;done 3<1 4<2
1
a
2
b
3
c
1,970
Posted By SaCai
awk '/IP/{P=$NF;i=1};i&&/#User/{print...
awk '/IP/{P=$NF;i=1};i&&/#User/{print $2"@"P;i=0}' filename
xxxxxxxxx@11.11.11.11
yyyyyyyyyyyyy@11.11.11.22
13,071
Posted By SaCai
[root@~]# bash array.sh 2 4 6 [root@~]# cat...
[root@~]# bash array.sh
2 4 6
[root@~]# cat array.sh
#!/bin/bash
b=(1 2 3)
a=0
for i in ${b[@]}
do
narray[${a}]=$((${b[$a]}*2))
((a++))
done
echo ${narray[@]}

Test...
34,134
Posted By SaCai
sed '$d' file Test environment : centos 5.5
sed '$d' file

Test environment : centos 5.5
1,272
Posted By SaCai
[root@dist unix]# cat file Record 1: ...
[root@dist unix]# cat file
Record 1:
::::::::::::::::::::::
::::::::::::::::::::::
ID "000001"
::::::::::::::::::::::
::::::::::::::::::::::
Record 2:
::::::::::::::::::::::...
1,741
Posted By SaCai
[root@dist unix]# sed 's/../&:/g;s/://7g' file ...
[root@dist unix]# sed 's/../&:/g;s/://7g' file
21:00:00:12:34:34:56 asdf
21:00:00:12:34:34:78 asd3
21:00:00:12:34:34:23 asdf
21:00:00:12:34:34:45 asdf
21:00:00:12:34:34:89 asdf
2,902
Posted By SaCai
sed 's/^ //' file
sed 's/^ //' file
4,614
Posted By SaCai
[root@dist unix]# cat file abcd cdef opqr ...
[root@dist unix]# cat file
abcd
cdef
opqr
[root@dist unix]# bash dele.sh 1 3
bd
df
pr
[root@dist unix]# bash dele.sh 2 4
ac
ce
oq
[root@dist unix]# cat dele.sh
#!/bin/bash
while read i...
5,113
Posted By SaCai
[root@dist unix]# cat a.sh #!/bin/bash n=0 ...
[root@dist unix]# cat a.sh
#!/bin/bash
n=0
for i in {1..9};do
n=${i}" "${n}
echo ${n}
done
[root@dist unix]# bash a.sh
1 0
2 1 0
3 2 1 0
4 3 2 1 0
5 4 3 2 1 0
6 5 4 3 2 1 0
7...
2,673
Posted By SaCai
#!/bin/bash while read i do wget...
#!/bin/bash
while read i
do
wget ${i}

done < <(grep -oP '(?<=>)\w.*(?=</)' urlfile)
5,300
Posted By SaCai
sed 'N;s/\n/,/' file
sed 'N;s/\n/,/' file
1,198
Posted By SaCai
thanks Scrutinizer , good reasoning.
thanks Scrutinizer , good reasoning.
2,181
Posted By SaCai
#!/bin/bash while read i do mkdir...
#!/bin/bash
while read i
do
mkdir $(echo ${i:6:2}) && mv $i $(echo ${i:6:2})
done < <(ls |awk --posix '$0~/[A-Z]{2}.txt$/')
1,198
Posted By SaCai
Shell script problem
I have two files.

file 1 content is
jerry 123
tom 456
shrek 789

file 2 contents is
a@hotmail.com
b@hotmail.com
c@hotmail.com
d@hotmail.com
e@hotmail.com
f@hotmail.com

Now, i want...
2,115
Posted By SaCai
#!/bin/bash a=0 while read line; do ...
#!/bin/bash
a=0
while read line;
do
array[${a}]="${line}"
((a++))
done <file

echo ${array[0]}
echo ${array[1]}
echo ${array[2]}
1,481
Posted By SaCai
b=are [[ $b =~ ^b ]] && echo match
b=are
[[ $b =~ ^b ]] && echo match
2,394
Posted By SaCai
huaihaizi good reasoning
huaihaizi good reasoning
Showing results 1 to 17 of 17

 
All times are GMT -4. The time now is 01:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy