10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Here's my code:
awk -F '' 'NR==FNR {
if (/time/ && $5>10)
A=$2" "$3":"$4":"($5-01)
else if (/time/ && $5<01)
A=$2" "$3":"$4-01":"(59-$5)
else if (/time/ && $5<=10)
A=$2" "$3":"$4":0"($5-01)
else if (/close/) {
B=0
n1=n2;
... (2 Replies)
Discussion started by: klane
2 Replies
2. Shell Programming and Scripting
pcmpath query device |awk 'BEGIN{print "DEVICE NAME\tSERIAL"} /DEVICE NAME/ {printf "%s\t", $5; getline; print substr($2, length($2)-3)}'
This script returns output like below to pull out "DEVICE NAME SERIAL".
......
hdisk28 110B
hdisk29 1112
hdisk30 1115
hdisk31 1116
hdisk32 1128... (2 Replies)
Discussion started by: Daniel Gate
2 Replies
3. Shell Programming and Scripting
Hi Guru's.
I am trying to use to check if $5 is greater than 80 & if not 100, then to print $0 :
awk '{ if ($5>80) && if ($5 != 100) print $0}
But getting error:
>bdf1|sed 's/%//g'|awk '{ if ($5>80) && if ($5 != 100) print $0}'
syntax error The source line is 1.
The error... (6 Replies)
Discussion started by: rveri
6 Replies
4. Shell Programming and Scripting
I am parsing file for the fields using awk command, first i check 26th field for two characters using substr function if it matches then using for loop on array i search 184th field for 4 chars if it matches then i print the required fields but on execution i get the error, please help...... (5 Replies)
Discussion started by: siramitsharma
5 Replies
5. Solaris
So I was patching a Solaris 10 U08 X86 X2200 box in preparation for an Oracle upgrade. Rebooted the box because the patches failed and the box will not boot successfully. I need to back up the zones on the 2 drives before going further. I pulled the drives and attempted to mount them on my Ubuntu... (0 Replies)
Discussion started by: LittleLebowski
0 Replies
6. Shell Programming and Scripting
I have two files which I would like to compare and then manipulate in a way.
File1:
pictures.txt 1.1 1.3
dance.txt 1.2 1.4
treehouse.txt 1.3 1.5
File2:
pictures.txt 1.5 ref2313 1.4 ref2345 1.3 ref5432 1.2 ref4244
dance.txt 1.6 ref2342 1.5 ref2352 1.4 ref0695 1.3 ref5738 1.2... (1 Reply)
Discussion started by: linuxkid
1 Replies
7. Shell Programming and Scripting
hi
i was trying to optimize one script and i came across this problem .. i am putting some pseudo code here
$ >cat a.sh
ls | while read I
do
i=$(($i + 1))
done
echo "total no of files : "
$ >ksh a.sh
total no of files :
$ >bash a.sh
total no of files :
why is... (1 Reply)
Discussion started by: zedex
1 Replies
8. UNIX for Dummies Questions & Answers
I cut specific cell(row=2, column=1) in my excel file and created new file using following script.
awk -F"," 'NR ==2 {print $1}' file1.csv > file1_new.csv
awk -F"," 'NR ==2 {print $1}' file2.csv > file2_new.csv
and so on....
The problem is that I have thousand files and I have to... (4 Replies)
Discussion started by: yonhk
4 Replies
9. UNIX for Dummies Questions & Answers
I want to store a set of string values in a 1-D array
and then iterate the list by using a loop.
Please help this dummy:) (1 Reply)
Discussion started by: ngagemaniac
1 Replies
10. Shell Programming and Scripting
How can I find which version of Awk is installed? OpSystem is HPUX 11.x
I am getting an error when trying to use the keyword nextfile and I dont know why! (Well, I can only assume that I have am using a version of Awk that does not support nextfile. However, according to O'Reilly, nextfile is... (3 Replies)
Discussion started by: google
3 Replies