Grep Info

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Grep Info
# 1  
Old 10-12-2007
Grep Info

What is NR this statement

grep '^[0-9]\{1,10\}$' $colfile | awk '{print "my_col_id("NR") := "$2";"}' >> $SQL_TEMP_FIL

# 2  
Old 10-12-2007
'man nawk' yeilds:
       NR     ordinal number of the current record

       FNR    ordinal number of the current record in the current file

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Inconsistent `ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l`

i have this line of code that looks for the same file if it is currently running and returns the count. `ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l` basically it is assigned to a variable ISRUNNING=`ps -eaf -o args | grep -i sfs_pcard_load_file.ksh |... (6 Replies)
Discussion started by: wtolentino
6 Replies

2. Shell Programming and Scripting

Grep/awk part of info of a column

I have a question that I am at a loss to solve. I have 3 column tab-separated data, such as: abs nmod+n+n-commitment-n 349.200023 abs nmod+n+n-a-commitment-n 333.306429 abs into+ns-j+vn-pass-rb-divide-v 295.57316 abs nmod+n+ns-commitment-n 182.085018 abs nmod+n+n-pledge-n ... (2 Replies)
Discussion started by: owwow14
2 Replies

3. UNIX for Dummies Questions & Answers

How to: Grep certain info from HWinfo

Just a noob here trying to get some help :D I am in need of certain information from multiple servers. These servers are Dell PowerEdges with OpenSuSE 10.2 to 11.3. Here are some lines from /usr/sbin/hwinfo and information I need from those lines: OEM id: "DELL" Product: "PowerEdge 850"... (1 Reply)
Discussion started by: eg mike
1 Replies

4. Shell Programming and Scripting

need a one liner to grep a group info from /etc/group and use that result to search passwd file

/etc/group tiadm::345:mk789,po312,jo343,ju454,ko453,yx879,iy345,hn453 bin::2:root,daemon sys::3:root,bin,adm adm::4:root,daemon uucp::5:root /etc/passwd mk789:x:234:1::/export/home/dummy:/bin/sh po312:x:234:1::/export/home/dummy:/bin/sh ju454:x:234:1::/export/home/dummy:/bin/sh... (6 Replies)
Discussion started by: chidori
6 Replies

5. Shell Programming and Scripting

How to pull info under headers in file(awk,grep,while loop)

below is an extract from my file and I am trying to use Awk and grep and a while loop to pull infomation from under neath "HBA WWN=".HBA WWN=" reoccurs all over the file but the 100000c.....number are unique and I want to be able to pull and reference specifi information under this header ever time... (2 Replies)
Discussion started by: kieranfoley
2 Replies

6. Shell Programming and Scripting

MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else

Hi Guys, I need to set the value of $7 to zero in case $7 is NULL. I've tried the below command but doesn't work. Any ideas. thanks guys. MEM=`ps v $PPID| grep -i db2 | grep -v grep| awk '{ if ( $7 ~ " " ) { print 0 } else { print $7}}' ` Harby. (4 Replies)
Discussion started by: hariza
4 Replies

7. Shell Programming and Scripting

Getting LV Info

I have this working ksh, and it returns like below: LOGICAL VOLUME: prod_2048_005 VOLUME GROUP: prod1vg TYPE: raw WRITE VERIFY: off PHYSICAL VOLUME: hdisk108 VOLUME GROUP: prod1vg TOTAL PPs: 1023 (130944 megabytes) VG DESCRIPTORS: 1 USED PPs: 904 (115712 megabytes) MAX REQUEST: 1 megabyte... (1 Reply)
Discussion started by: Daniel Gate
1 Replies

8. UNIX for Dummies Questions & Answers

Some Info.

Hiya all ... i am a newbie to UNIX, Just want to knwo what this command does: /sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}' I think, 'grep shows the line with 'inet addr' (which is the 2nd line, displaying the IP Address, Broadcast Address and Subnet Mask) ... Is... (8 Replies)
Discussion started by: ad4m88
8 Replies

9. Shell Programming and Scripting

Need Info

Hi, I'm a oracle DBA with little knowledge of Unix. I wanted to write some shell scripts which will be helpful for DBA's regular activity. As i'm a new to oracle with unix can any plese tell me what are all the activities can be done throgh Unix Shell Scripts also suggest me how to learn... (1 Reply)
Discussion started by: msgobinathan
1 Replies

10. UNIX for Dummies Questions & Answers

SU info

from the man page of su: EXAMPLES Example 1: Becoming User bin While Retaining Your Previously Exported Environment To become user bin while retaining your previously exported environment, execute: example% su bin Example 2: Becoming User bin and ... (4 Replies)
Discussion started by: afflack
4 Replies
Login or Register to Ask a Question