On Sun, 16 Feb 2003, Per olof Ljungmark wrote:

> Need advice on how to modify first line of shell script so that script
> can run normally (as called from another program, not from the command
> line) and write debugging output to a file like:

Short answer: you can't.  Not if you absolutely want to change
just the first line, and not really if you want the script to
run "normally", as you would have to divert stderr.

> #!/bin/sh
> echo DEFANGED.1007
> exit
> #!/bin/sh -xv <pipe stuff to file>


  exec 2> /tmp/logfile; set -xv
  # rest of script here...

Should work, except for the script being unable to print stuff to

There is also the possibility that I'm totally missing your point... :)


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to