Help with awk script, changing the FS for a single variable
Hi all, im new to awk and would apreciate if you could tell me how to do this, i have a file with several entries like this:
im trying to get the values on the last field, which would be the description of the event (eg. USB to Serial Connection Test - start) , but i need to further separate this field with a "-" to know if the test started or ended, the last field is a bit variable so i figured y could use something like this:
of course, that prints the second field of the entire line, which is the year... hehe... is there a way to tell awk to output the variable's second field delimited by a "-"?
I have the following script, and I want to assign the output ($10 and $5) from awk to N and L:
grdinfo data.grd | awk '{print $10,$5}'| read N L
output from gridinfo data.grd is: data.grd 50 100 41 82 -2796 6944 0.016 0.016 3001 2461. where N and L is suppose to be 3001 and 100. I use... (8 Replies)
Hi All
REQUIREMENT:-
==========
There is one folder named /data/ds/dpr_ukdw_sys/working/unixfile
In that folders there are files are like below
CODS_ACTMZ_TRANS_ALL_20150911.TXT
CODS_ACTMZ_REF_CTR_ACT_MIL_20150911.TXT
CODS_ACTMZ_REF_NHA_ALL_20150911.TXT ... (4 Replies)
Dear all,
I have kind of used both the awk/sed command and found them really useful.
But at the necessity I am having right now, I need help.
Actually, I would like to do the following in file script.sh
PATH535="/eos/uscms/store/user/pooja04//analysis2012/535/mc/summer12/002/tt/"
... (2 Replies)
I have a input file like this
select column1,column2 from tablename where column3='1000000001';
select column1,column2 from tablename where column3='1000000002';
select column1,column2 from tablename where column3='1000000003';
select column1,column2 from tablename where column3='1000000004';... (4 Replies)
Hi i have to insert the below line into a specific line number of another file
export MBR_CNT_PRCP_TYPE_CODES_DEL="'01','02','04','05','49','55','UNK'"
I have passed the above line to a variable say ins_line. I have used below command to perform the insert
awk 'NR==3{print "'"${ins_line}"'"}1'... (1 Reply)
This is a problem with basic Unix scripting. Thanks for looking!
1. The problem statement, all variables and given/known data:
Make a script that will compare 2 given directories and output those filenames that are in Directory 1 and not 2
2. Relevant commands, code, scripts, algorithms:... (1 Reply)
Dear All,
we have a command output which looks like :
Total 200 queues in 30000 Kbytes
and we're going to get "200" and "30000" for further process. currently, i'm using :
numA=echo $OUTPUT | awk '{print $2}'
numB=echo $OUTPUT | awk '{print $5}'
my question is : can I use just one... (4 Replies)
Helllo UNIX Forum :)
Since I am posting on this board, yes, I am new to UNIX!
I read a copy of "UNIX made easy" from 1990, which felt like a making a "computer-science time jump" backwards ;)
So, basically I have some sort of understanding what the basic concept is.
Problem Description:... (6 Replies)
I have a continous polling happening inside a shell script on AIX. This actually calls a PL/SQL block. Is there a way I can set up a variable or pass an interrupt to end the script gracefully. I cant read from the config once the job starts running. Ideally I should change value of a variable and... (1 Reply)
Let a script needs a variable to execute. For example if i run ./test.sh then it needs a variable as there is a <STDIN> in the script. I want to execute it as in command line.
Let test.sh requires a variable name $number I want to execute it by
>test number <enter>
how is it possible? (1 Reply)