Your browser does not seem to support CSS. If images appear below, please disregard them.
Topic Options
Rate This Topic
#16440 - 07/07/03 11:57 PM help: IFS in /bin/sh
Joined: Jun 2002
Posts: 2
bellini Offline
Junior Member
bellini Offline
Junior Member

Joined: Jun 2002
Posts: 2
i've ben trying to make something work but still havent figured something out.
I do the following:
[[email protected] ~]$ IFS=/
[[email protected] ~]$ export IFS
[[email protected] ~]$ PATH=.:$PATH
[[email protected] ~]$ echo "/bin/sh" > bin
[[email protected] ~]$ chmod 755 bin

Now the problem is:
if I execute 'sh -c "/bin/ls"' it just does a simple ls
But if i do 'sh -c "sh -c \"/bin/ls\""' it does what i expected (it executes the file 'bin')

Why doesn't it does the same in the first example??

thank's for your spent time.

Top
Sponsored Links
#16441 - 07/08/03 01:57 AM Re: help: IFS in /bin/sh
Joined: Mar 2002
Posts: 1,136
pergesu Offline
UGN Elite Poster
pergesu Offline
UGN Elite Poster

Joined: Mar 2002
Posts: 1,136
Pimpin the Colorizzle
You don't need the quotes...

Code:
$ sh -c /bin/ls
filea fileb filec filed

Top
#16442 - 07/08/03 03:10 AM Re: help: IFS in /bin/sh
Joined: Jun 2002
Posts: 2
bellini Offline
Junior Member
bellini Offline
Junior Member

Joined: Jun 2002
Posts: 2
Yes i know that gives me the list of files in the directory, but what i was expecting is to execute with that very same command line the program bin,due to my configuration of my IFS in sh.

Top

Member Spotlight
Crime

Crime
SC, usa
Posts: 506
Joined: March 2002
Show All Member Profiles 
Sponsored Links
Forum Statistics
Forums46
Topics46,445
Posts81,615
Members2,157
Most Online1,567
Apr 25th, 2010
Latest Postings
Top Posters(All Time)
UGN Security 39,609
Gremelin 7,195
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860