projects
/
mdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1fdd586
)
Basic support of shell aliases
author
Frederic Massart
<fred@moodle.com>
Mon, 18 Feb 2013 08:25:25 +0000
(16:25 +0800)
committer
Frederic Massart
<fred@moodle.com>
Mon, 18 Feb 2013 08:25:25 +0000
(16:25 +0800)
moodle
patch
|
blob
|
history
diff --git
a/moodle
b/moodle
index
95eb103
..
c33c314
100755
(executable)
--- a/
moodle
+++ b/
moodle
@@
-53,6
+53,12
@@
ALIAS=`$BIN show $COMMAND`
if [ -n "$ALIAS" ]
then
+ # It's a shell command.
+ if [[ ${ALIAS:0:1} == '!' ]]; then
+ ${ALIAS:1}
+ exit $?
+ fi
+ # If we're here, it's not a shell command. Let's parse the command and arguments.
COMMAND=`echo $ALIAS | cut -d ' ' -f 1`
ALIASARGS=`echo $ALIAS | cut -d ' ' -s -f 2-`
ARGS="$ALIASARGS $ARGS"