Re: How to run a process without a controlling terminal?

From: Chris F.A. Johnson (cfajohnson_at_gmail.com)
Date: 01/26/05


Date: 26 Jan 2005 04:03:37 GMT

On Wed, 26 Jan 2005 at 03:12 GMT, Scott Simpson wrote:
> Chris F.A. Johnson wrote:
>
>> On Wed, 26 Jan 2005 at 02:40 GMT, Scott Simpson wrote:
>>> I want to test if a script of mine works in an environment without a
>>> controlling terminal. Is there any way to run a command with the
>>> TIOCNOTTY ioctl turned on without writing a C program? I guess I can
>>> write a C program that does this and do a fork/exec but I'd rather not.
>>> Can I close /dev/tty in the shell somehow or run a command to do it?
>>
>> Would using at (or a cron job) work?
>
> That would probably do it. Guess I'll try. Pretty silly just to get rid of a
> controlling terminal.

    You could use a function (or a separate script):

noterm()
{ ## USAGE: noterm COMMAND [OPTIONS] [ARGS]
  printf "%s\n" "$@" | at now
}

-- 
    Chris F.A. Johnson                  http://cfaj.freeshell.org/shell
    ===================================================================
    My code (if any) in this post is copyright 2004, Chris F.A. Johnson
    and may be copied under the terms of the GNU General Public License


Relevant Pages

  • Football for Baseball
    ... 193 Chris Simms ... 199 Rudi Johnson ... 225 Mike Peterson ... Marvin Harrison ...
    (rec.collecting.sport.football)
  • football for baseball
    ... Thing is we only collect cards of a few baseball players ... 193 Chris Simms ... 199 Rudi Johnson ... Marvin Harrison ...
    (rec.collecting.sport.baseball)
  • Re: REQUEST
    ... I save my puzzles in AcrossLite text format. ... Chris F.A. Johnson ... Overjoyed by the European Community still ...
    (rec.puzzles.crosswords)
  • Re: sed problem: variables countaining special symbols
    ... Chris F.A. Johnson wrote: ... My script is falling over with a sed problem. ... That's bacause $NPASS contains a slash. ...
    (comp.unix.shell)
  • Re: Interesting list
    ... On 2007-06-13, Chris F.A. Johnson wrote: ... of the top ten ways to irritate your Web site's visitors. ... Pop Ups ...
    (alt.html)