bug-textutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Split problem


From: Bob Proulx
Subject: Re: Split problem
Date: Thu, 9 Nov 2000 12:48:51 -0700 (MST)

> I  think  the  split  (split --help) utility is supressing the "split"
> function of AWK/Shell.
> See man awk/split for desired funcionality.
> Can be a problem as split is VERY useful function of awk/shell

Thank you for your report but unfortunately you have a syntax error on
your command line and you are not even executing the awk program nor
are you executing the external split command.

> $ echo 9/29/83 |awk'{split($0,date,"/");print date[3]}'
                    ^^^ Need a space here.
> bash: awk{split($0,date,"/");print date[3]}: No such file or directory

The shell is giving you the proper error message.  You have explicitly
applied quoting to join 'awk' with '{split($0,date,"/");print
date[3]}' and so the shell is looking for that explicit string as a
command.  It can't find it and so it returns that error.

Note that the awk program uses it's own version of split internally
and does not call the external command split found in textutils.

Note that some characters are special to the command shell and need
no spaces to separate them.  The pipe (|) is one such meta-character
but the single quote (') is not.  Therefore with the |awk in your
example the shell will handle them seperately because unless quoted |
is a special character to the shell.

Further information can be found in the online bash shell info pages
or in most UNIX shell programming books.

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]