10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to run the awk below. My question is when I split the input, then run anotherawk to perform a calculation using that splitas the input there are no issues. When I try to combine them the output is not correct, is the split not working or did I do it wrong? Thank you :).
input
... (8 Replies)
Discussion started by: cmccabe
8 Replies
2. Shell Programming and Scripting
Hi All,
I am using an awk script as below:
awk -F'|' 'BEGIN{OFS="|";} { if ($1==$3 && $3==$7 && $7==$13 && $2==$6 && $6==$11 && $15-$14+1==$11) print $0"|""TRUE"; else print $0"|""FALSE"; }' tempfile.txt
In above script, all conditions are being checked except the one which is... (4 Replies)
Discussion started by: angshuman
4 Replies
3. Shell Programming and Scripting
sed -n "2,10p" lfile | egrep error | egrep -vc memory
sed -n "2,10p" lfile | egrep error | egrep -v memory
sed -n "2,10p" lfile | egrep error | egrep -c memory
sed -n "2,10p" lfile | egrep error | egrep memory
above are four separate commands. i want to combine the grep in each... (7 Replies)
Discussion started by: SkySmart
7 Replies
4. Shell Programming and Scripting
hi,
can someone tell me how can I translate the following line from sed to awk?
`sed 's/^*:*:*:*:*:\(*\):.*/\1/
How to use code tags when posting data and code samples. (14 Replies)
Discussion started by: adam25bc
14 Replies
5. Shell Programming and Scripting
Hello,
I have a bunch of xml file that needs to have edits made and I was wondering if a BASH script could handle it.
I would like the script to look within my xml files and replace all integers greater than 5px with a value that is 25% smaller. For example, 100px = 75px. Since the integers... (12 Replies)
Discussion started by: jl487
12 Replies
6. Shell Programming and Scripting
Hi,
I have a csh:
set NODES = `cat $HOST_FILE`
set NODELIST = $TMPDIR/namd2.nodelist
echo group main >! $NODELIST
foreach node ( $NODES )
echo host $node >> $NODELIST
end
@ NUMPROCS = 2 * $#NODES
I am very frustrated to translate it to bash:
NODES = `cat... (3 Replies)
Discussion started by: rockytodd
3 Replies
7. Shell Programming and Scripting
I am getting the error:
Runtime error (func=(main), adr=10): Divide by zero
When executing the mathematical expression:
echo "scale=2; 1-(0/0)"|bc
How to overcome this? (5 Replies)
Discussion started by: proactiveaditya
5 Replies
8. Shell Programming and Scripting
Hi,
How can i do the mathematical calculations in bash shell?
Are the mathematical functions available in bash shell?
Ex:
pow
ceil
floor
sqrt (5 Replies)
Discussion started by: cola
5 Replies
9. UNIX for Dummies Questions & Answers
I have some geometric data (X Y) that is in the wrong scale. My raw data is in mills but it needs to be in tenths of a mil
I am pretty familiar with awk and sed
I want to use awk to divide $1 and $2 by .1
I'm just not sure of the syntax $1 and $2 are variables and .1 is fixed
simple... (3 Replies)
Discussion started by: awk_sed_hello
3 Replies
10. Shell Programming and Scripting
Hallo all,
I have a script which creates an output ... see below:
root@a7germ:/tmp/pax > cat 20061117.txt
523.047
521.273
521.034
517.367
516.553
517.793
513.114
513.940
I would like to use awk to calculate the (a)total sum of the numbers (b) The average of the numbers.
Please... (4 Replies)
Discussion started by: kekanap
4 Replies