Re: Auto repeat of a command
From: Alexis Huxley (alexis_at_dione.no-ip.org)
Date: 07/30/03
- Next message: Ben: "Re: Auto repeat of a command"
- Previous message: Ed Morton: "Re: Another fgrep query"
- In reply to: Cynthia: "Auto repeat of a command"
- Next in thread: Ben: "Re: Auto repeat of a command"
- Reply: Ben: "Re: Auto repeat of a command"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 30 Jul 2003 16:46:34 +0200
> example: rep ls 15
>
> My script works for simple commands like: ls or bdf. But when I enter
> more complex commands (~ie. ps -ef | grep master) it picks up the
> command until the first space.
Supply the argument of fixed "word width" first; i.e. the
repetition count which is always one word long:
rep 15 ls
Then 'shift' off this one word with something like:
COUNT=$1
shift
And the what you want will be left in "$@" (with the quotes):
CMD="$@"
-- Alexis http://dione.no-ip.org/~alexis/
- Next message: Ben: "Re: Auto repeat of a command"
- Previous message: Ed Morton: "Re: Another fgrep query"
- In reply to: Cynthia: "Auto repeat of a command"
- Next in thread: Ben: "Re: Auto repeat of a command"
- Reply: Ben: "Re: Auto repeat of a command"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|