1 articles tagged "null string"
- BASH shell scripting tip: Set default values for variable
A shell variable may be assigned to by a statement using following syntax:
var=value
If value is not given, the variable is assigned the null string. In shell program it is quite useful to provide default value for variables. For example consider rsync.sh script:
#!/bin/bash
RSRC=$1
LOCAL=$2
rsync -avz -e ’ssh ‘ user@myserver:$RSRC $LOCALThis script can be run as follows:
$ ./rsync.sh [...]
Viewing 1-1 of 1 posts. ( see all popular tags )


Recent Comments
Yesterday ~ 38 Comments
Yesterday ~ 1 Comment
Yesterday ~ 1 Comment
06/16/2008 03:23 pm ~ 3 Comments
Yesterday ~ 3 Comments