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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

bash$ sh hello.sh<br />

Hello, world.<br />

The $(COMMAND) form has superseded backticks for command substitution.<br />

output=$(sed −n /"$1"/p $file) # From "grp.sh" example.<br />

# Setting a variable to the contents of a text file.<br />

File_contents1=$(cat $file1)<br />

File_contents2=$(

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

Saved successfully!

Ooh no, something went wrong!