27.08.2015 Views

Advanced Bash−Scripting Guide

Advanced Bash-Scripting Guide - Nicku.org

Advanced Bash-Scripting Guide - Nicku.org

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

# Delete CR and write to new file.<br />

echo "Original DOS text file is \"$1\"."<br />

echo "Converted UNIX text file is \"$NEWFILENAME\"."<br />

exit 0<br />

<strong>Advanced</strong> <strong>Bash−Scripting</strong> <strong>Guide</strong><br />

Example 12−17. rot13: rot13, ultra−weak encryption.<br />

#!/bin/bash<br />

# rot13.sh: Classic rot13 algorithm,<br />

# encryption that might fool a 3−year old.<br />

# Usage: ./rot13.sh filename<br />

# or ./rot13.sh

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!