Linux / UNIX Tech Support Forum
This is a discussion on repeat command is missing within the Shell scripting forums, part of the Development/Scripting category; hey i wanna repeat 3 echo hello world. but command not found is there a link or something for missing ...
|
|||||||
| Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
| Sponsored Links | ||
|
|
|
||||
|
How about?
PHP Code:
__________________
Vivek Gite Linux Evangelist |
|
|||
|
Repeat is not a standard command. However, it is trivial to implement.
Put this in a file called repeat, make it executable and put it in a directory in your PATH: Code:
n=$1 shift while [ $(( n -= 1 )) -ge 0 ] do "$@" done |
|
|||
|
Quote:
|
|
|||||
Quote:
Quote:
Quote:
Quote:
Quote:
|
![]() |
| Tags |
| bash , for loop , linux , shell scripting , unix |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| what am I missing? | katsushiro | Windows Xp/2000/2003 server administration | 0 | 23-06-2009 08:37 PM |
| save command and command output | savook | CentOS / RHEL / Fedora | 1 | 08-05-2009 05:33 PM |
| NPTL...MISSING in Centos !!!!!!!!!!! | amsreeku | Linux software | 0 | 08-08-2008 03:10 AM |
| If error repeat the download? | karabaja | Shell scripting | 3 | 10-10-2006 02:32 AM |