Re: run script nuances...

Laurent Bercot <[email protected]>
Newsgroups gmane.comp.djb.syslog
Message-ID <[email protected]>
> #!/bin/sh
> exec 2>&1
> exec supervised_command options parameters
> 
> and
> 
> #!/bin/sh
> exec supervised_command options parameters 2>&1
> 
> Are they equivalent?

 They are. You might prefer the former style if you're
performing one or more instructions before the final exec,
all of them with 2>&1 ; but it's a matter of taste.

 Anyway, the best way to write your script is obviously the following:

#!/command/execlineb -P
fdmove -c 2 1
supervised_command options parameters

 ;)

-- 
 Ska
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.