Previous Thread
Next Thread
Print Thread
Rate Thread
#16440 07/07/03 04:57 PM
Joined: Jun 2002
Posts: 2
B
Junior Member
Junior Member
B Offline
Joined: Jun 2002
Posts: 2
i've ben trying to make something work but still havent figured something out.
I do the following:
[user@host ~]$ IFS=/
[user@host ~]$ export IFS
[user@host ~]$ PATH=.:$PATH
[user@host ~]$ echo "/bin/sh" > bin
[user@host ~]$ 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
▼ Sponsored Links ▼ ▲ Sponsored Links ▲
#16441 07/07/03 06:57 PM
Joined: Mar 2002
Posts: 1,136
P
UGN Elite Poster
UGN Elite Poster
P Offline
Joined: Mar 2002
Posts: 1,136
You don't need the quotes...

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

#16442 07/07/03 08:10 PM
Joined: Jun 2002
Posts: 2
B
Junior Member
Junior Member
B Offline
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.


Link Copied to Clipboard
Member Spotlight
Gremelin
Gremelin
Portland, OR; USA
Posts: 7,204
Joined: February 2002
Forum Statistics
Forums41
Topics33,839
Posts68,797
Members2,177
Most Online73,244
Nov 9th, 2025
Latest Postings
Top Posters
UGN Security 41,392
Gremelin 7,204
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Top Likes Received
Ghost 2
Girlie 1
unreal 1
Crime 1
Ice 1
Dartur 1
Powered by UBB.threads™ PHP Forum Software 8.0.0