11-17-2010
Was confused at the nawk for a sec then realized I should be using gawk
Thanks for all your help guys. I really want to understand why these work though, so could someone explain the '{close(out);out=$(NF-2);print $(NF-3)>>out}' part if its not too much of a hassle?
So gawk -F is using "=" as a delimiter and then splitting up the output that way? then I assume the parts are assigned to $# variables then the $(NF-2 or 3) is getting the 'hostname' and 'domain' parts?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I wanted to cut a specific portion from given string. How would I do that?
Example:
/u09/core/inbound/abc.txt is my string.
I want abc.txt in a variable.
Please help me.
Regards,
Dhaval (3 Replies)
Discussion started by: dhaval_khamar
3 Replies
2. Shell Programming and Scripting
Hi,
I am trying to execute a command like this:
find ./ -name "*.gz" -exec sh -c 'zcat {} | awk -f parse.awk' \; >> output
If I want to print the filename, i generally use the -print argument to the find command but when I am redirecting the output to a file, how can I print just the... (2 Replies)
Discussion started by: Legend986
2 Replies
3. Shell Programming and Scripting
HI Guys,
I need some expert help.. i have this below data as input
WHERE StartTime >= '2010-03-24 20:10:08'
AND username in('abc_xxx_yyy_01')
and output need is
just
in
appreciate your help on this !!!!
thanks you ... (8 Replies)
Discussion started by: nitinrp1
8 Replies
4. Shell Programming and Scripting
Hi All,
I am trying to write a small shell programming to get db2 database size info. The command I am going to use is- db2 "CALL GET_DBSIZE_INFO(?, ?, ?, -1)"
and the output of above command generally is-
Value of output parameters
--------------------------
Parameter Name :... (4 Replies)
Discussion started by: NARESH1302
4 Replies
5. Shell Programming and Scripting
Hi,
I have a tab-delimited txt file as below. It is part of the original file.
I want to cut the lines starting with "3" in column1 and paste them before the lines starting with "1" in column 1. So I will get
Anyone knows any simple shell scripts to do that? The original file is... (5 Replies)
Discussion started by: cliffyiu
5 Replies
6. Shell Programming and Scripting
I have a file that contain the following.
-D HTTPD_ROOT="/usr/local/apache"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
I want a shell script, so that after cat filename and apply the shell script I should get the output as follows.
/usr/local/apache/conf/httpd.conf
ie
cat filename |... (7 Replies)
Discussion started by: anilcliff
7 Replies
7. Shell Programming and Scripting
Hi,
I am new to scripting and need help in cutting strings from output of a command. For exapmle in am getting the following as the out out from the command i run:
Out Condition: Askajdsdfa | date: 1204 | oper: +
I need to get the output as Askajdsdfa and 1204.
Thanks (3 Replies)
Discussion started by: hraj1984
3 Replies
8. Shell Programming and Scripting
here are the few scenarios...
isoSizeKB text NOT NULL,
reserved1 varchar(255),
KEY `deviceId` (`deviceId`)
`d5` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`dHead` enum('HistoryInfo','Diversion') COLLATE utf8_unicode_ci,
`ePR` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
... (7 Replies)
Discussion started by: vivek d r
7 Replies
9. UNIX for Beginners Questions & Answers
Running this code
df -h | head -2 | awk '{print $8}'
Gives me the following output:
%iused
6%
What I'm trying to do is get the 6% but I'm having trouble doing this using cut -c, I think that this could be because the text is on different lines; is there a way of doing this? (8 Replies)
Discussion started by: $shell_Learner
8 Replies
10. UNIX for Beginners Questions & Answers
Hi,
On AIX 7
I have :
grep 's_ohs_instance_loc' $CONTEXT_FILE
<ohs_instance_loc oa_var="s_ohs_instance_loc">/u01/appl_top/env/fs1/FMW_Home/webtier/instances/EBS_web_env_OHS1</ohs_instance_loc>
But I need only this part:... (4 Replies)
Discussion started by: big123456
4 Replies
LEARN ABOUT SUNOS
wnn_hinsi.data
wnn_hinsi.data(4) File Formats wnn_hinsi.data(4)
NAME
wnn_hinsi.data - Wnn6 part of speech administration file
SYNOPSIS
/usr/lib/locale/ja/wnn/ja/hinsi.data
DESCRIPTION
hinsi.data is a file that contains information required to administer the main parts of speech.
Numbers are allocated in the order of the parts of speech and composite parts of speech defined in hinsi.data. These numbers are used
when creating dictionary files and part of speech files, when looking up part of speech names by numbers from the client and server, and
looking up the parts of speech in composite parts of speech. Numbers are assigned in ascending order starting at 0.
Only the following operations are allowed for this file: appending new parts of speech or composite parts of speech to the end of the file
and replacing lines consisting of only "@" with definitions of parts of speech or composite parts of speech. NEVER DELETE ENTRIES. "@" is
used to reserve lines in the file in advance when part of speech names have not yet been determined.
The part of speech formats for lines in this file are as follows:
part_of_speech
composite_part_of_speech $ part_of_speech : part_of_speech:...:part_of_speech
All parts of speech appearing in definitions of composite parts of speech must be defined before the composite part of speech can be
defined. There must not be more than one part of speech or composite part of speech with the same name.
Everything on a line following a semicolon (;) is treated as comment and ignored.
Information on this file (looking up part of speech names from part of speech numbers and looking up the structural elements of composite
parts of speech) are provided by the library and can thus be referenced through the client process.
EXAMPLES
Example 1:
[SENTOU] ;Beginning of a sentence
[MEISHI] ;Indicates a noun.
[ICHIDAN]
[ICHIDANMEI]$[ICHIDAN]:[MEISHI] ;A composite part of speech
@
@
NOTES
Information on the main parts of speech must be consistent between all dictionaries and connection information files. Do not edit and
change hinsi.data. (If the file is changed, the meaning of the part of speech numbers in dictionaries and connection information files
created with the old part of speech administration file will change.)
SunOS 5.10 28 May 1998 wnn_hinsi.data(4)