Re: Master rsync script for many file servers
David <[email protected]> Fri, 12 May 2006 11:38:37 +1000
| Newsgroups | gmane.org.user-groups.mlug.main |
|---|---|
| Message-ID | <[email protected]> |
Geoffrey Scott wrote:
> David wrote:
>
> Hi David, that's really useful. Can I ask a few things about how/ why
> you've done things? Or can you point me to some docs where I can RTFM
> for the answer.
>
>>
>> #!/usr/bin/env bash
>
> Why do you call env with bash as an argument? In what way is it better
> than just #!/bin/bash ?
>
Makes your script portable, /usr/bin/env exists on all OS's - will cause
/usr/bin/env to search for bash instead of setting explicitly, just in
case that bash(1) lives in /usr/local/bin for example.
>>
>> for host in ${HOSTS} ; do
>
> When you expand variables why do you use curly braces?
>
Just habit from korn shell days, you can use curly braces or double
quotes to expand a variable - everyone has different scripting styles.
>
>> HIH.
>
> Yes it will. Cheers!
>
David.