Your browser does not seem to support CSS. If images appear below, please disregard them.
It appears that you're running an Ad-Blocker. This site is monetized by Advertising and by ">User Donations; we ask that if you find this site helpful that you whitelist us in your Ad-Blocker, or make a ">Donation to help aid in operating costs.
Previous Thread
Next Thread
Print Thread
Rate This Thread
#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.

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
Happy Birthday 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

#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.


Member Spotlight
Gremelin
Gremelin
Portland, OR; USA
Posts: 7,198
Joined: February 2002
Show All Member Profiles 
Forum Statistics
Forums45
Topics34,109
Posts69,256
Members2,167
Average Daily Posts3
Members2,167
Most Online1,567
Apr 25th, 2010
Latest Postings
My friend NEEDS your HELP!
by Lena01 on 07/21/17 07:06 AM
my old account still exists!
by Lena01 on 07/21/17 07:03 AM
Hello Everyone
by Lena01 on 07/21/17 07:02 AM
I'm having fun with this guy.
by gabithompson730 on 07/20/17 08:50 AM
I want to upgrade my phone
by gabithompson730 on 07/20/17 08:49 AM
Newbie here
by gabithompson730 on 07/20/17 08:46 AM
Blackbeard.....
by Gremelin on 01/14/17 07:03 PM
Top Posters(All Time)
UGN Security 41,342
Gremelin 7,198
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Top Liked Users (All Time)
§intå× Likes: 3
Black Beard Likes: 1
Cold Sunn Likes: 1
Crime Likes: 1
Cyrez Likes: 1
fleshwound Likes: 1
Ghost Likes: 2
Gremelin Likes: 12
Ice Likes: 1
ninjaneo Likes: 1
Top Liked Users (30 Days)
No Data Found
Powered by UBB.threads™ PHP Forum Software 7.6.0
(Snapshot build 20170206)