POV-Ray : Newsgroups : povray.off-topic : Is this the end of the world as we know it? : Re: Is this the end of the world as we know it? Server Time
30 Jul 2024 06:30:05 EDT (-0400)
  Re: Is this the end of the world as we know it?  
From: Jim Henderson
Date: 23 Oct 2011 13:47:51
Message: <4ea45347$1@news.povray.org>
On Sun, 23 Oct 2011 11:44:55 +0100, Orchid XP v8 wrote:

> On 23/10/2011 10:48 AM, Warp wrote:
> 
>>    I didn't say unix users have learned *all* tools via their manpages.
>> I just said it's the case with many (or even most) tools.
> 
> YOU didn't, no. But Jim seemed to be strongly hinting at it.

No, I didn't say that, nor did I hint at that.  I was relating my own 
experience.

>>    (As for that particular problem, it's "for F in *; do echo $F;
>>    done",
>> or if you are using zsh, you can also write "for F (*) echo $F".)
> 
> Just a few lines of example code could have helped me figure this out in
> a few minutes instead of several hours. (And this must surely be a VFAQ
> for shell scripting; it's just about the simplest task you could
> possibly want to script!)

for name [ [ in [ word ... ] ] ; ] do list ; done

That's in the man page.

To find a specific example, in my case, I'd grep through existing scripts 
on the system, starting with the init scripts.

For example, in /etc/init.d/boot, I found:

for i in ${bootrc}/S${rex}*; do

In order to parse this, one needs to understand how variable expansion 
takes place, but that's covered in the man page.

Jim


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.