Date: Mon, 28 Apr 1997 22:40:01 -0700 (PDT) From: John-Mark Gurney <jmg@hydrogen.nike.efn.org> To: freebsd-bugs Subject: Re: bin/3387: sh mis-interpret the file name / awk failure Message-ID: <199704290540.WAA26812@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/3387; it has been noted by GNATS. From: John-Mark Gurney <jmg@hydrogen.nike.efn.org> To: "Jin Guojun[ITG]" <jin@george.lbl.gov> Cc: fenner@parc.xerox.com, FreeBSD-gnats-submit@freebsd.org, bugs@freebsd.org Subject: Re: bin/3387: sh mis-interpret the file name / awk failure Date: Mon, 28 Apr 1997 22:29:53 -0700 Jin Guojun[ITG] scribbled this message on Apr 28: > } That's correct. What's really going on is that "uname -v" outputs a > } space at the end. > } > } % echo ">>`uname -v`<<" > } >>FreeBSD 2.2-RELEASE #0: Mon Mar 24 11:03:31 GMT 1997 root@sundae.parc.xero > } x.com:/usr/src/sys/compile/SUNDAE << > } > } so if you split on slashes and get the last piece, it is indeed "SUNDAE ". > } awk is performing as you ask it to. > > Thanks for pointing it out. This tells that GNU awk is innocent. > Then, the futher question is "Can we change uname to make no space at the end?" > I am happy to fix it, but every one have to agree to do so. Comments? well.. I just checked with Solaris' awk.. and it doesn't do it like this... echo "sdlfk/sdfkj " | awk -F/ "{printf $NF }" so the real fix is stop uname for including that extra space... also.. it would fundamentally break awk... with awk you expect to get everything EXACTLY between the field seperator (except for in the special case the man page mentions)... there is no extra field seperator between the end of text and the new line... so the space is part of the field... I personally would object to this modification the awk.. and hope that this crazy idea doesn't every get into your mind again.. :) what I wouldn't object to is another flag that strips that white space from around the fields... -- John-Mark Cu Networking Modem/FAX: +1 541 683 6954 Live in Peace, destroy Micro$oft, support free software, run FreeBSD
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704290540.WAA26812>