10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Team(Solaris 5.8/Ksh),
How can we save grep output to awk variable when grep returns more than one line or word.
abc.log
# more abc.log
Hi Makarand
How r u
bye Makarand
Hello
when grep returns only 1 word below command works
nawk -v var=`cat abc.log |grep "Hello"` 'BEGIN { if... (6 Replies)
Discussion started by: Makarand Dodmis
6 Replies
2. Shell Programming and Scripting
I am using an awk command to extract a particular portion of a string. Below is the command and its output on a Linux system:
oracle@host1:/tmp (/home/oracle)
$uname -a
Linux host1 2.6.32-279.39.1.el6.x86_64 #1 SMP Fri Nov 15 05:38:26 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
... (7 Replies)
Discussion started by: veeresh_15
7 Replies
3. Shell Programming and Scripting
Hi All,
I am trying to find out number of cores present for hp-ux server from the output of print_manifest (as shown below). i suppose awk will be best tool to use for filtering.
output of print_manifest is :
System Hardware
Model: ia64 hp Integrity Virtual Partition
... (6 Replies)
Discussion started by: omkar.jadhav
6 Replies
4. Shell Programming and Scripting
Hi Experts,
I have a Text file generated as below;
<NAME>
NEW#<technicalName><TAB> <Version>
OLD#<technicalName><TAB> <Version>
e.g.
CH_PPV_AUDIT_DISTRIBUTOR
NEW#EL_CFG_FTP_DISTRIBUTOR 2.1.0.upc2
OLD#EL_CFG_FTP_DISTRIBUTOR 2.1.0.upc1... (19 Replies)
Discussion started by: rajangupta2387
19 Replies
5. Shell Programming and Scripting
hi Friends ,
I have a file as below
s.txt
1~2~~4
2~6~~7
3~8~~9
t.txt
1~2~~4
2~5~8~7
3~8~~7
header for both files is common (2 Replies)
Discussion started by: i150371485
2 Replies
6. UNIX for Dummies Questions & Answers
cat doc | nawk -v da="${date}" '$23>199 {print $0 > "doc"+da+".txt"}'
Every time(need to run every day) i run this, i want to a create a new file "doc_01 Aug.txt".
Basically, i want to create a new file with date appended in it.
The above command is creating a file with name "0".... (4 Replies)
Discussion started by: vagar11
4 Replies
7. Shell Programming and Scripting
half of the problem is already solved with the help of bartus11 suggestion
I have a txt file having rows and coulmns, i want to perform some operation on a specific coulmn starting from a specific line.
50.000000 1 1 1
1000.00000
1000.00000
... (5 Replies)
Discussion started by: shashi792
5 Replies
8. Emergency UNIX and Linux Support
i have a file which gets appended with 9 records daily and the file keeps growing from then...i use to store the previous day files count in a variable called oldfilecount and current files count as newfilecount.my requirement is that i need to start processing only the new records from the... (3 Replies)
Discussion started by: ganesh_248
3 Replies
9. Shell Programming and Scripting
Hi -
I have a file with contents as below.
12.1 a.txt
12.1 b.txt
12.1 c.txt
13.2 a.txt
13.2 d.txt
14.3 f.txt
15.4 a.txt
15.4 b.txt
15.4 z.txt
I need to print the contents like this.
12.1 a.txt
< >< >< >b.txt
< >< >< >c.txt (7 Replies)
Discussion started by: guruparan18
7 Replies
10. Shell Programming and Scripting
Hi
I have tried this command
cat /etc/passwd | awk -F: '{print$5}'
note that the $5 is the column that displays full name- i.e. Kevin Kambell
To the point, my output is fine except one thing I do not understand that some of output lines have space in front of them which I checked in... (7 Replies)
Discussion started by: lalelle
7 Replies