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

From CDOT Wiki
Jump to: navigation, search
(Bash Scripting Help)
(Tips)
Line 12: Line 12:
 
rm -r $tmExternal >> $dateError.txt  
 
rm -r $tmExternal >> $dateError.txt  
 
fi
 
fi
 +
</source>
 +
 +
 +
* The increment operator in bash
 +
<source lang=bash>
 +
 +
while [ $revTmpInternal -lt $revInternal ]; do
 +
((revTmpInternal++))
 +
done
 
</source>
 
</source>

Revision as of 11:46, 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


  • The increment operator in bash
while [ $revTmpInternal -lt $revInternal ]; do
	((revTmpInternal++))
done