Search Results

Search: Posts Made By: r2007
8,715
Posted By r2007
i see, you want to put the code in another script...
i see, you want to put the code in another script and run it. try it[untested]
echo "sed '${lineNum}i\\${sourceString}\\' ${dataSource}" > nir.ksh
9,521
Posted By r2007
sorry, i am not look into your script last time....
sorry, i am not look into your script last time. it shold like this[untested]:
read var < <(vmstat 1 1 |...)
there has a blank between tow "<"s, and no blank between "<" and "("
12,705
Posted By r2007
if eval [ "\$DATA$x" = "element0" ]; then echo...
if eval [ "\$DATA$x" = "element0" ]; then echo element 0 found; fi
or
eval [ "\$DATA$x" = "element0" ]&& echo element 0 found
8,715
Posted By r2007
try: sed ${lineNum}i'\'${sourceString}'\'...
try:
sed ${lineNum}i'\'${sourceString}'\' ${dataSource}
or
sed ${lineNum}i\\${sourceString}\\ ${dataSource}
9,521
Posted By r2007
be careful, there should have a blank character...
be careful, there should have a blank character between the two "<"s
read var < < echo $(vmstat 1 1 |...)
9,521
Posted By r2007
FYI. From BASH Frequently-Asked Questions...
FYI. From BASH Frequently-Asked Questions (http://www.faqs.org/faqs/unix-faq/shell/bash/)
38,021
Posted By r2007
awk way: awk 'NR==FNR{a[$1]=$2}NR!=FNR{if($1 in...
awk way:
awk 'NR==FNR{a[$1]=$2}NR!=FNR{if($1 in a)$1=a[$1];print}' ren f_name
62,042
Posted By r2007
dc is another choice. it's up to you. dc -e...
dc is another choice. it's up to you.
dc -e '1.1 1+p'
38,021
Posted By r2007
try: grep -vf mypattern myfile
try:
grep -vf mypattern myfile
3,838
Posted By r2007
sed '/process-type...
sed '/process-type id="'"$SCHEMA_NAME"'"/,/<\/process-type>/{ /<port id="rmi"/s/foo1/bar1/; /<port id="jms"/s/foo2/bar2/; }'
13,379
Posted By r2007
exec 3>&1 RC=$(exec 4>&1;{ proc;echo $? >&4;...
exec 3>&1
RC=$(exec 4>&1;{ proc;echo $? >&4; }|tee -a logfile >&3)
exec 3>&-
echo $RC
4,492
Posted By r2007
for gnu awk: awk 'ORS=(i=!i)?",":RS'...
for gnu awk:
awk 'ORS=(i=!i)?",":RS' myLogFile
4,053
Posted By r2007
final word. how fun *nix is! i like it. the...
final word. how fun *nix is! i like it.

the normal way is like this :o
sed '$!N;s/\n//'
2,785
Posted By r2007
sed 's/[^(]*//'
sed 's/[^(]*//'
7,477
Posted By r2007
awk 'FNR==1 {offset=-$1;if(NR>1)...
awk 'FNR==1 {offset=-$1;if(NR>1) close(of);of=FILENAME".out"} {$1+=offset; print >of}' GPS*.xyz
13,136
Posted By r2007
try export...
try
export PATH="/usr/ccs/bin:/opt/sfw/bin:/usr/local/sbin:/usr/local/bin:$PATH"
or
setenv PATH="/usr/ccs/bin:/opt/sfw/bin:/usr/local/sbin:/usr/local/bin:$PATH"
1,908
Posted By r2007
the difference is the number of rows.
the difference is the number of rows.
29,300
Posted By r2007
try: for (( i=1;i<=100;i++ )) do echo...
try:
for (( i=1;i<=100;i++ ))
do
echo $RANDOM $i
done|sort -k1|cut -d" " -f2|head -10|while (condition)
do
read number
do some work here using random number until condition satisfied
done
29,300
Posted By r2007
well, the bash variable "$RANROM" is a random...
well, the bash variable "$RANROM" is a random integer between 0 and 32767. if the condition is independent of generated random number, try to imagine the loop block has already run 32768 cycles, all...
29,300
Posted By r2007
Select 10 numbers from 1 through 80 for ((...
Select 10 numbers from 1 through 80

for (( i=1;i<=80;i++ )) do echo $RANDOM $i; done|sort -k1|cut
-d" " -f2|head -10

it works using bash
11,447
Posted By r2007
it works with GNU bash(version 2.05b) on gentoo. ...
it works with GNU bash(version 2.05b) on gentoo.
try:
comm -13 <(cut -d: -f1 $testfile.lst | sort | uniq) <(cut -d: -f1 $testfile.lst.old | sort | uniq) >results.lst
1,908
Posted By r2007
gnu sed: sed -n '1h;1!{g;p}'
gnu sed:
sed -n '1h;1!{g;p}'
2,079
Posted By r2007
except the 1st field, rest of fields will be...
except the 1st field, rest of fields will be highlight with <b> tag.
try:
awk '{for(i=2;i<=NF;i++)$i="<b>"$i"</b>";print}'
2,395
Posted By r2007
gnu sed: sed...
gnu sed:
sed 'h;s/.......//;x;s/\(.......\).*/\1/;s/ /0/g;G;s/\n//'
2,079
Posted By r2007
gnu awk: awk '$2="<b>"$2"</b>"' old.html...
gnu awk:
awk '$2="<b>"$2"</b>"' old.html >new.html
Showing results 1 to 25 of 73

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