10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I am using the below script which has awk command, but it is not returing the expected result. can some pls help me to correct the command.
The below script sample.ksh should give the result if the value of last 4 digits in the variable NM matches with the variable value DAT. The... (7 Replies)
Discussion started by: G.K.K
7 Replies
2. Shell Programming and Scripting
#ifconfig -a | nawk '/1.1.1.1/{print}'
inet 1.1.1.1 netmask xxxxxxxxx broadcast 0.0.0.0
If i assign the ip to a variable and search for the variable nothing gets printed!!
# ifconfig -a | nawk -v ip=1.1.1.1 '/ip/{print}'
I am not able to understand why this is happening! (6 Replies)
Discussion started by: chidori
6 Replies
3. Shell Programming and Scripting
Hi,
Below work fine, whenever any character puts, however if we use "(", it's not working.
Working
===============
echo 'Sau(rabh is Nice' | nawk -v a="Saurabh" '{print substr($1,1,match($1, "u"))}'
Not working
====================
echo 'Sau(rabh is Nice' | nawk -v a="Saurabh" '{print... (3 Replies)
Discussion started by: sbaisakh
3 Replies
4. Shell Programming and Scripting
Hi all
Having issue with substitution using sed
Trying to assign the absolute path of the file to the variable 'floc' returned by the find command
floc=`find / -name $fname`
eg cat $floc '/root/samplecheck/myfile'
I want to replace '/' with '->' in the 'floc' i am using the below sed... (2 Replies)
Discussion started by: amithsebkanattt
2 Replies
5. Shell Programming and Scripting
Hi All,
I am seeing an issue while using toupper in nawk. Below is the code that I am using.Toupper method is not working as expected in this case.nawk 'NR==FNR{a=$4" "$5}NR>FNR{print NF?$0:a"\n";if(/^cn:/) x=toupper($0)}' FS="" id_list.txt attributes.txt > out
In the above script, id_list... (9 Replies)
Discussion started by: Samingla
9 Replies
6. Shell Programming and Scripting
Hello everyone ...
I'm going crazy, I hope some of you can help me ...
I have to replace a line in a crontab like this:
5 2 * * 2 root backupdat
with this:
5 5 * * 3 root backupdat
the command I use is the following:
sed -i.bak -e 's/5 2 * * 2 root backupdat/5 5 * * 3 root... (4 Replies)
Discussion started by: ionral
4 Replies
7. Shell Programming and Scripting
Hi ,
I have have file which has following structure
01aaaa88888000-9999
01ssss77777000-0991
01ssss7777700000991
02ssss7777700000991
The record 01 is corrupt as value from 12th field to 19th should be positive or start with - however it is 000-9999 it should be -0009999
i need to... (4 Replies)
Discussion started by: test_user
4 Replies
8. Shell Programming and Scripting
I have a report which contains the following:
Count Value %
47 69.12
18 26.47
3 4.41
I want to grep the total on the bottom brackets and store in a variable. However this may have a different figure everyday.
To read the i do:
... (1 Reply)
Discussion started by: Pablo_beezo
1 Replies
9. Shell Programming and Scripting
1) ABC::2197.12:2197.12:120217144365::+DEF:INT:1:N::::6:550.00:0.00:2009-04-29:CN:4547425069636596::6:N:mrs charles:N:PH:00010031:0001'
OUTPUT - ABC::2197.12:2197.12:120217144365::+DEF:INT:1:N::::6:550.00:0.00:2009-04-29:CN:4547******636596::6:N:mrs charles:N:PH:00010031:0001'
The... (5 Replies)
Discussion started by: mad_man12
5 Replies
10. Solaris
#!/bin/ksh
VAR_ONE=HELLO
TEMP=ONE
echo $VAR_${TEMP}
## Output is: ONE
Hi, I want the output to echo HELLO and not ONE as the above script does. I know I am missing something with dollar substitution. Can anyone help me out ?
Thanks.
Cal (4 Replies)
Discussion started by: calredd
4 Replies