This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: env :xargs no such file or directory


> From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com]On Behalf
> Of Vikram Mehta

> I am on  cygwin
> If the code of given below script is run , I get an error
> env: xargs no such file or directory found
> This error comes form the last line of the code.
>
> f [ -f "$$ROMFSDIR/bin/busybox" ]; then \
>  inode=`ls -i $$ROMFSDIR/bin/busybox | awk '{print $$1}'`; \
>  ls -i "$$ROMFSDIR/bin" | grep "^ *$$inode" | awk '{print $$2}' | \
>   sed "s:^:$$ROMFSDIR/bin/:" | env -i xargs rm -f; \
> fi
>
> What I cannot understand is what is the phrase
> env -i xargs rm -f doing.

$ info env

> What may be the reason for the error and how canI remove it
>
> env works
> and xargs also works but this does not work


$ env -u PATH echo HEY
env: echo: No such file or directory

$ env  echo HEY
HEY

$ env -i echo HEY
env: echo: No such file or directory

$ env -i /bin/echo HEY
HEY

$ uname -a
CYGWIN_NT-5.0 P450 1.3.22(0.78/3/2) 2003-03-18 09:20 i686 unknown unknown
Cygwin

 Seems to me that there is some PATH problem or so... "-i" removes all
export/set variables, including PATH. Thus 'env' can't find commands.

 To temporarily 'fix' the above script; remove '-i' option from 'env' - or
maybe remove 'env -i' and leave just xargs, or
 ... | env PATH=/bin xargs rm -f

$ echo TEST 1 2 3 | env -i PATH=/bin xargs echo HEY
HEY TEST 1 2 3

/Hannu E K Nevalainen, Mariefred, Sweden, 59o14'N, 17o12'E. 25o C yesterday.
--END OF MESSAGE--


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]