[GTALUG] Bash Problem
Mauro Souza
thoriumbr at gmail.com
Mon Jan 9 19:01:36 EST 2017
I almost always use them. Only left them out for very simple scripts.
It's not really necessary all the time, but better safe than sorry...
On Jan 9, 2017 22:00, "Bob Jonkman via talk" <talk at gtalug.org> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Chris F.A. Johnson wrote:
> The braces are not necessary here.
Are braced incorrect here? I've been putting braces around all
variable names, so that there are fewer syntax exceptions for me to
remember...
- --Bob.
On 2017-01-09 05:47 PM, Chris F.A. Johnson via talk wrote:
> On Sun, 8 Jan 2017, Mauro Souza via talk wrote:
>
>> Or nFname="${base}.mp4"
>>
>> Using brackets you can mix variables and text and create
>> something like this:
>> newName="${oldname}-bkp-${filedate}.${extension}.old"
>
> The braces are not necessary here. This will work fine:
>
> newName="$oldname-bkp-$filedate.$extension.old"
>
> Braces would be necessary if you were using underscores instead of
> hyphens because they can be part of a variable name:
>
> newName="${oldname}_bkp_$filedate.$extension.old"
>
- --
- --
Bob Jonkman <bjonkman at sobac.com> Phone: +1-519-635-9413
SOBAC Microcomputer Services http://sobac.com/sobac/
Software --- Office & Business Automation --- Consulting
GnuPG Fngrprnt:04F7 742B 8F54 C40A E115 26C2 B912 89B0 D2CC E5EA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Ensure confidentiality, authenticity, non-repudiability
iEYEARECAAYFAlh0I9wACgkQuRKJsNLM5erWdQCgohmGdSVT2s1DHEWs+3+I3BCn
nR4AoM8TVyt53lC3KhHC6uecvy09Zq9z
=Af5d
-----END PGP SIGNATURE-----
---
Talk Mailing List
talk at gtalug.org
https://gtalug.org/mailman/listinfo/talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gtalug.org/pipermail/talk/attachments/20170109/253a3a69/attachment.html>
More information about the talk
mailing list