Created
September 4, 2014 12:25
-
-
Save dedeibel/e94ef4ad9cf708623391 to your computer and use it in GitHub Desktop.
Run all the given commands separated by terminal ;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
COMMAND="" | |
for arg in $@; do | |
if [ "$arg" = ";" ]; then | |
$COMMAND | |
COMMAND="" | |
else | |
COMMAND="$COMMAND $arg" | |
fi | |
done | |
if [ -n "$COMMAND" ]; then | |
$COMMAND | |
fi | |
# | |
# Useful when you want to pass multiple command to another shell command for execution, for | |
# example when watching for file changes (watch_file_changes is some inotify watch command) | |
# | |
# watch_file_changes DIR command* | |
# watch_file_changes dir_to_watch doall synch_to_remote \; display_growl_notification \; aplay /usr/share/psi/sound/send.wav |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment