Created
October 10, 2014 13:39
-
-
Save siburu/bda08845ea1cf9c3efce to your computer and use it in GitHub Desktop.
Ban -j option
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 | |
args= | |
afterj=false | |
for arg in $* | |
do | |
if [ "$arg" = '-j' ] | |
then | |
afterj=true | |
elif [ $afterj = true ] | |
then | |
afterj=false | |
if [[ ! "$arg" =~ ^[0-9]+$ ]] | |
then | |
args="$args $arg" | |
fi | |
else | |
args="$args $arg" | |
fi | |
done | |
/usr/bin/make $args |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment