--SunOS 5.10 nawk for paragraph not working


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting --SunOS 5.10 nawk for paragraph not working
# 8  
Old 07-05-2019
Quote:
There are still some scripts laying around that depend on that version of awk.
Don, they would all work with nawk. Or can you show me one that does not, or give me a pointer?
# 9  
Old 07-05-2019
Quote:
Originally Posted by gilgamesh
Thank you.

Unfortunately, the sed/awk commnands that work on other platforms
do not work on Solaris.

At least in the environments I work in.
[..]
That is because those scripts do not adhere to the POSIX standards for sed and awk. If they were written to be compliant, they would most likely also have worked on Solaris using /usr/xpg4/bin/awk and /usr/xpg4/bin/sed

For example in standard awk the variable RS can only be a single character. Only GNU awk and mawk support the use of a regular expression in RS as an extension to the standard.
# 10  
Old 07-09-2019
Quote:
Originally Posted by MadeInGermany
Don, they would all work with nawk. Or can you show me one that does not, or give me a pointer?
Hi MadeInGermany,
The original awk didn't have as many built-in variables as nawk. For example, if an original awk script used a variable named RS (which was not defined by the original awk but is the record separator in nawk and in the standards) the old script could behave very differently if that variable was set to anything other than a <newline> character.

I no longer have access to the old awk scripts that failed when run with nawk or /usr/xpg4/bin/awk and don't remember which variables they used, but it was things like this that caused awk to remain compatible with the original awk rather than making it a link to nawk on Solaris systems at least through Solaris 10.
These 2 Users Gave Thanks to Don Cragun For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Sendmail not working in SUNOS

Hi All i am trying to send a mail from SunOS to my outlook mail but it is not working neither giving any error please suggest # uuencode /tmp/t.txt t.txt | mailx -s test v.com # # uname -a SunOS 5.9 Generic_122300-25 sun4u sparc SUNW,Sun-Fire-V440 (3 Replies)
Discussion started by: scriptor
3 Replies

2. UNIX for Advanced & Expert Users

Manipulate files with find and fuser not working as expected on SunOs

Greetings, For housekeeping, I use the following command: find /some/path -type f -name "*log*" ! -exec fuser -s "{}" 2>/dev/null \; -exec ls -lh {} \; It finds all log files not currently in use by a process and manipulates them. This command always works on linux and redhat machines,... (2 Replies)
Discussion started by: dampio
2 Replies

3. Shell Programming and Scripting

Nawk command not working for Question mark (?)

Hi Folks, I am facing an issue with nawk command. The data is as below: ABC0022,BASC,Scene Package,INR,02May17,XXX4266,be?. Hotel,3,AW01,Twin Room,61272,41308,39590,39590,X,X ABC0022,BASC,Scene Package,INR,02May17,XXX4266,be?. Hotel,3,AW02,Twin Room with Balcony,9272,85638,4520,9590,X,X... (1 Reply)
Discussion started by: kirans.229
1 Replies

4. Shell Programming and Scripting

mailx not working on SunOS 5.9

I m trying to send o/p of one file using mailx command but is not working PFB command : cat healthchecklog | mailx -s "HEALTH CHECKS" abc@jkl.com also I have checked the ps -ef for mailx which is giveing below o/p ps -ef | grep mail root 364 1 0 Jun 08 ? ... (11 Replies)
Discussion started by: Jcpratap
11 Replies

5. Solaris

SunOs 5.9: why is 'ulimit -c' not working?

I have a situation where the system is dumping a 2g causing filesystem to fill up. We identified the source and working on a solution. However, I wanted to limit the size of the 'core' file. Please examine the test scenario ... cnewtonne@mars> ulimit -f 0 cnewtonne@mars> ls -ltr core*... (2 Replies)
Discussion started by: cnewtonne
2 Replies

6. Solaris

All i/o (ftp) not working on this SunOS 5.10

Hi everyone: I have been trying to simply FTP a file over to this SunOS 5.10 (which is same as Solaris 10 now) and nothing works! I can only Telnet to this via SSH (with my own account/uid), and I can also send simple mail out with mailx, that's all!!! I cannot FTP to it (I think FTP... (7 Replies)
Discussion started by: steve701
7 Replies

7. Shell Programming and Scripting

Nawk Script not working

Any idea why this isn't working? YESTERF=`TZ=aaa24 date +%b"-"%d | sed 's/-0/--/'` filelist2=$(find /export/home/gen/cks/traces \( -name \*YESTERF\* -name \*DNA\* \) -print | tr '\n' ' ') print "Date/Time,Location,Shelf,IP,Reason,Log Filename" >> $OUTPUT nawk -F':' ' $2 ~... (2 Replies)
Discussion started by: ther2000
2 Replies

8. Solaris

tr -d is not working on SunOS 5.9

i am using sunos 5.9. entityname="india\/delhi" correctpattern="<branch value=\"/`echo $entityname | tr -d '\'`/WORKAREA/\"> echo $correctpattern the output should be <branch value="/india/delhi/WORKAREA/"> This is working fine in command line but not working when i placed these... (1 Reply)
Discussion started by: millan
1 Replies

9. UNIX for Dummies Questions & Answers

SunOS 5.10 - VI Arrow keys not working

Hi I am working on SunOS 5.10 from remote terminal using putty. Also echo $TERM xterm In vi editor when in insert mode arrow keys are not working for cursor movement instead they print A B C and D. Please help. thanks ravs (7 Replies)
Discussion started by: ravashingravi
7 Replies

10. Shell Programming and Scripting

NAWK Script not working fine

Hello to all can any one help me out with a nawk script. Actually i am having a shell script which uses nawk pattern searching and it is not parsing the file properly. I have been debugging it since long time, but nt able 2 find the root cause.. If any one can help me out with this one .. (3 Replies)
Discussion started by: dheeraj19584
3 Replies
Login or Register to Ask a Question

Featured Tech Videos