Parsing Parameters

How do you pass parameters over to another script and run the receiving script? .

Here is an example of what I am talking about.

for x in `cat Allx`

  do

  su myaccount -c "/temp/scripts/temp_script  $x"  > /dev/null 2>$1 $

done

I was expecting the tem_script to be fired up, but nothing happens. Can anyone tell me what I am doing wrong here?

Thanks,

Odogbolu98

First off, the su command will prompt you interactively for a password, and it expects you to enter it before continuing...

You won't see it, though since you are sending stdout to /dev/null, and it looks like you are trying to send stderr into stdout, although instead of using 2>&1, you are using 2>$1 (which would send stdout into the first argument of your script - I'm assuming it would create a file with that name)

The proper way to do it would be to do:
command >/dev/null 2>&1 &
instead of
command >/dev/null 2>$1 $

But since the su command is interactive, this shouldn't work anyways.

You can try setting up an account with sudo privelages that don't require a password to run a certain command (limit the command set to only that script), but you would need to talk to the admin about that.