Re: Execute all processes in the background from bash.

From: Kevin Collins (spamtotrash_at_toomuchfiction.com)
Date: 05/20/04


Date: Thu, 20 May 2004 16:52:49 GMT

In article <7960d3ee.0405200757.2b49b50f@posting.google.com>, Doug Freyburger
wrote:
> Ed Morton wrote:
>> Doug Freyburger wrote:
>>
>> > When I intend to run a command very often, I write a small script
>> > and name it "x" somewhere in my path. It would be something like:
>>
>> > #! /bin/bash
>> > time ${1} &
>>
>> You might want to make the above:
>> time "$@" &
>> so you capture arguments.
>
> Good point.
>
>> > exit
>>
>> No need for the exit.
>
> True but there isn't necessarily need for the magic number in the first
> line, either. I put them into all of my scripts for cleanliness reasons.

I assume you mean the "shebang" entry (#!/bin/bash)? If so, there is a need for
it, unless you want all your scripts to run as /bin/sh, which you probably
don't. :)

Kevin



Relevant Pages

  • Re: Execute all processes in the background from bash.
    ... > Ed Morton wrote: ... >> so you capture arguments. ... >> No need for the exit. ... I put them into all of my scripts for cleanliness reasons. ...
    (comp.unix.admin)
  • Re: speed of script execution
    ... the execution of the following scripts. ... Of course "don't use the curly braces" but this is part of a larger ...
    (comp.protocols.kermit.misc)
  • RE: /etc/init.d/ - add/remove services
    ... leave the links alone and just manipulate the scripts ... the "no" in the filename whereas with the "exit" you'd have to look in the ... control over the runlevels. ...
    (Debian-User)
  • The best scripts ever (trick or treat)
    ... POST YOUR COOLEST SCRIPTS! ... prints an optional argument to stderr and exits. ... # but may not exit with a code other than 0. ...
    (freebsd-questions)
  • Re: Closures
    ... use scripts.) ... But how big are the environments likely to be in these situations? ... Given that you don't have to capture global or namespace scopes, most places in Tcl where you use a script probably only have a few visible locals around -- due to Tcl's local-only-by-default policy. ... proc with the variables to capture from the environment: ...
    (comp.lang.tcl)