Created
October 16, 2012 22:23
-
-
Save agudulin/3902438 to your computer and use it in GitHub Desktop.
Bash: Homework FAIL
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/bash | |
if [ $# -eq 0 ]; then | |
echo "Error!"; | |
else | |
for arg in $@; do | |
if [ $arg == "name" ]; then | |
echo "yaska"; | |
elif [ $arg == "time" ]; then | |
echo `date +"%S:%M:%H %m.%d.%Y"`; | |
elif [ $arg == "nfile" ]; then | |
echo $((`ls | wc -l` + 10)); | |
elif [ $arg == "ndirs" ]; then | |
echo $((`ls -d */ | wc -l` + 10)); | |
else | |
echo ""; | |
fi; | |
done; | |
fi; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment