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

}<br />

eval "$s1"=\'"${s1_val}${s2_val}"\'<br />

# ==> eval $1='${s1_val}${s2_val}' avoids problems,<br />

# ==> if one of the variables contains a single quote.<br />

#:docstring strcmp:<br />

# Usage: strcmp $s1 $s2<br />

#<br />

# Strcmp compares its arguments and returns an integer less than, equal to,<br />

# or greater than zero, depending on whether string s1 is lexicographically<br />

# less than, equal to, or greater than string s2.<br />

#:end docstring:<br />

###;;;autoload<br />

function strcmp ()<br />

{<br />

[ "$1" = "$2" ] && return 0<br />

[ "${1}" '

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

Saved successfully!

Ooh no, something went wrong!