Re: Capturing output from scripts in rc3.d



you could add - probably to the top of /etc/init.d/rc or at the top of
your startup script or both...

#!/bin/sh # or whatever your shell is...
exec > log.txt
exec 2>&1
set -x

Regards
Ted Fiedler

.



Relevant Pages

  • Re: detect shell script language
    ... In the 'old' days, when a user typed in a command, the interactive shell would immediately pass it off to 'exec' to execute. ... So, on return from exec with an error status, the shell would fork a copy of itself to try and run the script. ... As a result of the above, it was hard to tell whether the script was a Bourne shell or C shell, so the convention was introduced of using the Bourne shell no op command, as the first line in a Bourne shell script. ...
    (Debian-User)
  • Re: [SLE] Compiled a C program, cannot run by name
    ... Your current directory is not checked for executables in most ... And why should the DOS shell be derided for providing this ... > I did a man exec and it seems to be a bash script executor, ... When calling "exec ./myapp" the process image of the shell is replaced ...
    (SuSE)
  • Re: How do I: Main thread spawn child threads, which child processes...control those child processe
    ... is that memory free'd when I use one of the exec*() functions? ... shell was fork/exec'ed by the shell. ... communications through a single pipe, but if portability is a concern ...
    (comp.unix.programmer)
  • Re: xsession file
    ... exec x-window-manager & ... the currently running shell with the new process. ... the 'sh' and won't run the desired shell as a login shell. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: Who calls main() in a C program?
    ... See man -s 2 exec on a Solaris system or man 3p exec on a Linux ... The argc and argv is how the command line arguments get ... writing a shell ...
    (comp.lang.c.moderated)