01-12-2017
How to detect awk and nawk?
I have 10 scripts which use awk/nawk extensively.
I have to always change awk to nawk and nawk to awk when i deploy all my scripts to different types of servers as some support nawk while other support awk.
Can you propose a solution that without having to tweak my 10 scripts at several places everytime i deploy them to a new set of servers the awk-nawk problem should be automatically addressed.
Note: I cannot change my user .profile as it is used by other users as well.
Last edited by mohtashims; 01-12-2017 at 05:39 PM..
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Can anyone explain to me why the first line doesn't work and the second seems to work fine. I am trying to find all occurances of text within a certain column (col 13) that start with the character V, I suppose it sounds simple but I have tried using the following but don't really understand what... (2 Replies)
Discussion started by: Gerry405
2 Replies
2. Shell Programming and Scripting
hi,
i have the command nawk -v i want to use it equivalent in awk?
any help please
:) (2 Replies)
Discussion started by: kamel.seg
2 Replies
3. UNIX for Dummies Questions & Answers
Hi all,
I can run the following script using nawk..However, I find that teh server dun support nawk.. May I know how to change teh script to use awk such that it will work? Very urgent.. thx!
nawk 'BEGIN {FS=OFS=","}
NR==FNR{arr=$2;next}
$0 !~ "Documentation"{print $0;next} ... (2 Replies)
Discussion started by: kinmak
2 Replies
4. Shell Programming and Scripting
i'm new to shell scripting and have a problem please help me
in the script i have a nawk block which has a variable count
nawk{
.
.
.
count=count+1
print count
}
now i want to access the value of the count variable outside the awk block,like..
s=`expr count / m`
(m is... (5 Replies)
Discussion started by: saniya
5 Replies
5. Shell Programming and Scripting
Hi guys I'm very new to unix and I have to create an awk script that detects webpage addresses from a file/webpage and outputs how many times each webpage was detected.e.g. if my file was:
(Note: The symbol " was added to stop them being created into links)
"www.google.com"... (1 Reply)
Discussion started by: ROFL
1 Replies
6. Shell Programming and Scripting
Hi guys I'm very new to unix and I have to create an awk script that detects webpage addresses from a file/webpage and outputs how many times each webpage was detected.e.g. if my file was:
www.google.com
www.facebook.com
www.google.com
the output should be:
www.google.com x2... (2 Replies)
Discussion started by: ROFL
2 Replies
7. UNIX for Dummies Questions & Answers
Hi everyone,
i am new to unix , so i want to know what is the use of awk and nawk.
because in most of the place this cmds were used.
so, if anyone provied the basic idea of this cmds, it will be much helpfull for me . . ..
Thnks in Advance :) (9 Replies)
Discussion started by: natraj005
9 Replies
8. Shell Programming and Scripting
Hi Guys,
I am in need of some help; I have an xml message file which contains personal details as shown below:
, message=, message=, message=, message=, message=, message=
I want to use nawk to parse these xml messages but I am new to awk and nawk.
What I want is to get output... (7 Replies)
Discussion started by: James_Owen
7 Replies
9. Shell Programming and Scripting
Hi ! programmers
I have a need of detecting empty field in file
my file looks like this
40.900|-71.600|1.6|20|1|1961|21.00|3.700||1|US|28035|10029370|31
40.900|-71.600|5.7|20|1|1961|21.00|3.700||1|US|28035|10029370|31
40.900|-71.600|7.8|20|1|1961|21.00|3.700||1|US|28035|10029370|31... (7 Replies)
Discussion started by: Dona Clara
7 Replies
LEARN ABOUT OPENDARWIN
ucblinks
ucblinks(1B) SunOS/BSD Compatibility Package Commands ucblinks(1B)
NAME
ucblinks - adds /dev entries to give SunOS 4.x compatible names to SunOS 5.x devices
SYNOPSIS
/usr/ucb/ucblinks [-e rulebase] [-r rootdir]
DESCRIPTION
ucblinks creates symbolic links under the /dev directory for devices whose SunOS 5.x names differ from their SunOS 4.x names. Where possi-
ble, these symbolic links point to the device's SunOS 5.x name rather than to the actual /devices entry.
ucblinks does not remove unneeded compatibility links; these must be removed by hand.
ucblinks should be called each time the system is reconfiguration-booted, after any new SunOS 5.x links that are needed have been created,
since the reconfiguration may have resulted in more compatibility names being needed.
In releases prior to SunOS 5.4, ucblinks used a nawk rule-base to construct the SunOS 4.x compatible names. ucblinks no longer uses nawk
for the default operation, although nawk rule-bases can still be specifed with the -e option. The nawk rule-base equivalent to the SunOS
5.4 default operation can be found in /usr/ucblib/ucblinks.awk.
OPTIONS
-e rulebase Specify rulebase as the file containing nawk(1) pattern-action statements.
-r rootdir Specify rootdir as the directory under which dev and devices will be found, rather than the standard root directory /.
FILES
/usr/ucblib/ucblinks.awk sample rule-base for compatibility links
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWscpu |
+-----------------------------+-----------------------------+
SEE ALSO
devlinks(1M), disks(1M), ports(1M), tapes(1M), attributes(5)
SunOS 5.10 13 Apr 1994 ucblinks(1B)