in reply to running shell script in cron

I wonder whether that program really worked outside the cron job. At least the command

cd $sc `script1.pl S & `
looks weird (or there are some arcane corners in shell scripting I'm still missing). Could you explain what it is supposed to do? I've never seen the use of the ampersand inside backquotes...

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^2: running shell script in cron
by parv (Parson) on Mar 26, 2009 at 09:27 UTC
    I wonder if there is some missing assignment (result of ``, which would still make cd fail in a normal, mordern bourne-like shell) or a missing semicolon (after the cd argument) ...
Re^2: running shell script in cron
by raghu_shekar (Novice) on Mar 25, 2009 at 01:30 UTC
    im trying to run the script in background and that s why im using '&'...... am i doin something wrong here??

      I was thinking that using & inside backquotes wouldn't work (and it doesn't make much sense since the caller would have to wait for the completion anyway). I tried it on Cygwin Perl, and at least it works here (using bash for shelling out). I don't know whether this is supposed to work in general.

      Another strange thing in your code is that you have
      cd $sc `...`
      So provided your backquoted string substitutes to blablabla, you would have something like
      cd $sc blablabla
      What is this supposed to do?

      -- 
      Ronald Fischer <ynnor@mm.st>