Avatar of GAUTAM
GAUTAMFlag for United States of America

asked on 

NAWK command help

Hi experts...
I am a newbie to UNIX.I found an Nawk command and have no idea what it means.Can anyone explain this command bit by bit
nawk -F "|" '{i=1;while(i<=NF){gsub(/^[ \t]+|[ \t]+$/,"", $i); if (length($i)>0) printf("%s|",$i) ; if (i==NF){printf("\n")};  i++}}' $rej_list | sed -e 's/.$//' >! $rej_list_fmt
Please help...

Shell Scripting

Avatar of undefined
Last Comment
GAUTAM
Avatar of GAUTAM
GAUTAM
Flag of United States of America image

ASKER

Hi experts can anyone help me on this...
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of GAUTAM
GAUTAM
Flag of United States of America image

ASKER

@woolmilkporc:This is run in tcsh shell.Is tcsh shell obsolete?
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

No, tcsh is not at all obsolete.

csh is rather old and a bit inconvenient, but is not obsolete either.

What I meant to say is that the redirection format ">!" is no longer mandatory for non-existing output files in neither shell, but can still be used in csh and tcsh nonetheless. ksh and bash don't recognize this format, however.

Thx for the points!

wmp
Avatar of GAUTAM
GAUTAM
Flag of United States of America image

ASKER

Thx for the reply.
Shell Scripting
Shell Scripting

The term 'shell' refers to a general class of text-based command interpreters most often associated with the UNIX and Linux operating systems. Popular shells include Bourne, Debian Almquist (dash), Korn (ksh), Bourne Again (bash) and the C shell family (csh). Some view the DOS 'cmd' prompt as a minimal shell of sorts. It is also possible to install Cygwin on Windows and emulate a full Unix environment with complete shell capabilities. Terminal emulators, such as xterm, GNOME Terminal and OS X Terminal, can be used to access shell.

11K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo