I\'m trying to understand a bash script whose first four lines are:
#!/bin/sh
SCRIPT=\"`basename $0 | sed \'s/\\..*$//\'`\"
CONFIG=${1:-$HOME/.$SCRIPT}
DIR=${2:-
From man bash
:
${parameter:-word}
Use Default Values. If parameter is unset or null, the expansion of word is substituted. Other‐
wise, the value of parameter is substituted.
Very easy to find, with man bash
, and then /:-
. The slash introduces a search, and :-
is just the content to search for. Else, searching in bash can get very boring, because it is huge, but here it is the first hit.