shell symbols and exec problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • new guy

    #1

    shell symbols and exec problem

    Hello
    I have a problem running following shell command from php exec or
    system call:
    exec("/bin/cat $(/bin/cat list.txt) > concatenated.tx t"). 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.t xt).
    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.tx t.
    Any advice appreciated! :)

  • Erwin Moller

    #2
    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.tx t"). 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.t xt).
    > 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.tx t.
    > Any advice appreciated! :)[/color]

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

    Regards,
    Erwin Moller

    Comment

    • ivo.rajmon@gmail.com

      #3
      Re: shell symbols and exec problem


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

      Comment

      Working...