Difference between revisions of "User:Minooz/RepoSyncProj/Bash"

From CDOT Wiki
Jump to: navigation, search
(Bash Scripting Help)
(Bash Scripting Help)
Line 3: Line 3:
 
:[http://arachnoid.com/linux/shell_programming.html Shell Programming]
 
:[http://arachnoid.com/linux/shell_programming.html Shell Programming]
 
: [http://www.linux.org/lessons/advanced/x1110.html Linux org]
 
: [http://www.linux.org/lessons/advanced/x1110.html Linux org]
 +
==Tips==
 +
*Watch the spaces
 +
<source lang=bash>
 +
 +
if [ -d "$tmpInternal" ]; then
 +
rm -r $tmpInternal >> $dateError.txt
 +
elif [ -d "$tmpExternal" ]; then
 +
rm -r $tmExternal >> $dateError.txt
 +
fi
 +
</source>

Revision as of 11:11, 18 October 2010

Bash Scripting Help

Tutorial
Shell Programming
Linux org

Tips

  • Watch the spaces
if [ -d "$tmpInternal" ]; then
	rm -r $tmpInternal >> $dateError.txt 
elif [ -d "$tmpExternal" ]; then
	rm -r $tmExternal >> $dateError.txt 
fi