|
![](/i/fill.gif) |
On Sun, 23 Oct 2011 21:01:55 +0100, Orchid XP v8 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.
>
> So saying "I learned everything I know about Unix just by reading the
> manpages" doesn't count as "strongly hinting that manpages are all you
> need"?
There's a difference between "I did this" and "everybody does this". I !
= everbody.
I also had experience with various forms of Unix from my past, so I
didn't need the introductory stuff, because I just adapted what I already
knew.
>>> 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.
>
> Uh... why does that need three nested levels of brackets?
You're the one who pointed out that it's BNF formatting (though I'm not
sure that's explicitly the case).
> Actually, suddenly I'm not sure I want to know the answer...
>
>> To find a specific example, in my case, I'd grep through existing
>> scripts on the system, starting with the init scripts.
>
> Presumably to do that I'd have to already know how to run grep over
> every file in a directory. :-P (Not to mention knowing how to operate
> grep - it's highly non-trivial, after all - as well as how to determine
> which files are Bash scripts...)
man grep gives you the information you need to use grep.
In my case:
grep -ri for /etc/init.d | less
The /etc/init.d scripts have the benefit of being exclusively bash
scripts. But if you want to know if it is, you just look for:
#!/bin/bash
as the first line of the script.
Jim
Post a reply to this message
|
![](/i/fill.gif) |