Re: Execute all processes in the background from bash.

From: Doug Freyburger (dfreybur_at_yahoo.com)
Date: 05/19/04

  • Next message: Ed Morton: "Re: Execute all processes in the background from bash."
    Date: 19 May 2004 10:12:50 -0700
    
    

    guerrilla_thought wrote:
    >
    > I was wondering if it's possible to prepend "time" and append "&" to all
    > commands that I execute in bash. For example I'd like
    > $ mozilla
    > to exapand to
    > $ time mozilla &
    > to time it and execute it in the background. Anyone know if this is
    > possible using bash, maybe with environment variables? It's quite
    > inconvenient to type time before and & after every command that I execute.

    All/every? I use ls, cd and so on often enough that would be a
    disaster for me.

    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} &
    exit

    Then I would type most of my commands normally and "x mozilla".
    Since you mentioned mozilla, you probably want to use "nohup" rather
    than "time".


  • Next message: Ed Morton: "Re: Execute all processes in the background from bash."

    Relevant Pages