[clug] Pointless time-wasting bash questions

csirac2 at gmail.com csirac2 at gmail.com
Thu Jun 25 22:54:28 MDT 2015


On a side-note, I'd love to see a PowerShell talk - curious to see how Microsoft apparently solves these problems (allegedly by having data types other than strings).

Sent from my android device.

-----Original Message-----
From: Bob Edwards <Robert.Edwards at anu.edu.au>
To: linux at lists.samba.org
Sent: Fri, 26 Jun 2015 14:42
Subject: Re: [clug] Pointless time-wasting bash questions

On 26/06/15 14:21, Paul Harvey wrote:
>> If I was to use it for real work I'd "eval ''". e.g.:-
>> for i in /GenericAgent. . ; do eval cp 'Kernel/Config${i}pm{.dist,}' ; done
>
> Is the eval necessary? What if ${i} expands to something like:
> '; rm -rf $HOME/*; echo'
>
> I suppose it's possible your code there is immune from this style of
> thing, but I hate having to think so hard and reason about eval.
>
> Perhaps I've just been over-exposed to bad perl code from the
> "meta-programming just means building eval strings" era :)
>

In this case of iterating through a list of traditional Unix (spaceless,
non-Unicode) filenames, as per the original question, I don't think the
eval buys you anything.

I don't enjoy playing with bash when I (very rarely) come across
non-traditional Unix filenames... If I wanted to play with 'doze or
MacOSX, I'd probably bother learning how to use Excel or ...

Horses for courses.

cheers,

Bob Edwards.
-- 
linux mailing list
linux at lists.samba.org
https://lists.samba.org/mailman/listinfo/linux


More information about the linux mailing list