Connecting Tech Pros Worldwide Forums | Help | Site Map

shell symbols and exec problem

new guy
Guest
 
Posts: n/a
#1: Mar 27 '06
Hello
I have a problem running following shell command from php exec or
system call:
exec("/bin/cat $(/bin/cat list.txt) > concatenated.txt"). This works
when i run it directly from the shell as user nobody (apache user), so
its not a path/permissions problem.
Basically list.txt contains a list of filenames, which are to be read
and concatenated into one big file (concatenated.txt).
I have even tried writing a shell script, wrapping this command, and
tried running it, but still no result. The script either way just
writes an empty concatenated.txt.
Any advice appreciated! :)


Erwin Moller
Guest
 
Posts: n/a
#2: Mar 27 '06

re: shell symbols and exec problem


new guy wrote:
[color=blue]
> Hello
> I have a problem running following shell command from php exec or
> system call:
> exec("/bin/cat $(/bin/cat list.txt) > concatenated.txt"). This works
> when i run it directly from the shell as user nobody (apache user), so
> its not a path/permissions problem.
> Basically list.txt contains a list of filenames, which are to be read
> and concatenated into one big file (concatenated.txt).
> I have even tried writing a shell script, wrapping this command, and
> tried running it, but still no result. The script either way just
> writes an empty concatenated.txt.
> Any advice appreciated! :)[/color]

Just an idea: Give the whole path to concatenated.txt might help.

Regards,
Erwin Moller
ivo.rajmon@gmail.com
Guest
 
Posts: n/a
#3: Mar 27 '06

re: shell symbols and exec problem



try using full pathes and maybe telling it what shell should be used
may help

Closed Thread