2009/1/30 Andrew Oakley <[email protected]>:
>[snip]
> Public domain, do as you like.
>
Slight bash optimisation included below...
> [snip]
>
> username=$1
>
> if [[ "$username" == "" ]]
>
> then
>
> username=$defaultusername
>
> fi
>
username=${1:-${defaultusername}}
This single line replaces both the assignment and the 'if..fi' block.
The unfortunate bit about this replacement is that no one understands
it without reading the bash man page! :-)
Cofion/Regards,
Neil.
--
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/