[KLUG Members] Shell scripts

Robert G. Brown members@kalamazoolinux.org
Tue, 25 Nov 2003 11:09:25 -0500


Yes, both newline and indentation provide more readability, and in written
scripts, I use both. Also, take a look at the scripts in /etc/rc.d/init.d,
and you'll see some fairly good examples of good scripting style.

On Tue, 25 Nov 2003 08:24:12 -0500, Jeremy Leonard<lists@elite4god.com> wrote:
>True. However, in most cases I think Newline makes the code more readable.
>
>
>>>> Robert G. Brown<bob@acm.org> 11/24/2003 4:27:40 PM >>>
>That's fine, the newline is a synonym for ;
>
>On Mon, 24 Nov 2003 16:20:12 -0500, "Jeremy Leonard" <lists@elite4god.com> wrote:
>>I've solved it.
>>
>>Here's what I wrote:
>>
>>for file in /dir/dir/dir/*.ext
>>do
>>echo "$1" > $file
>>done
>>
>>----- Original Message ----- 
>>From: "Robert G. Brown" <bob@acm.org>
>>To: <members@kalamazoolinux.org>
>>Sent: Monday, November 24, 2003 4:00 PM
>>Subject: Re: [KLUG Members] Shell scripts
>>
>>
>>> On Mon, 24 Nov 2003 15:52:40 -0500, "Jeremy Leonard" <lists@elite4god.com>
>>wrote:
>>>
>>> >I want to replace test in about 200 files....
>>> text (I'm assuming)
>>> >I can do everything except iterate on each file.....
>>> for name in list-of-files ; do something ; done
>>>
>>> list-of-files is
>>> String out the file names ... like more larry curly welby.doc
>>> or
>>> and expression in `'s that will list them, like:
>>> for `cat file-listing-files` ; do ...
>>>
>>> something is the command (or commands, separated by ;'s, that you want to
>>> run...
>>>
>>> Hope this helps!
>>> Regards,
>>> ---> RGB <---
>>>
>>> _______________________________________________
>>> Members mailing list
>>> Members@kalamazoolinux.org 
>>>  
>>>
>>
>>
>>_______________________________________________
>>Members mailing list
>>Members@kalamazoolinux.org 
>> 
>
>
>
>_______________________________________________
>Members mailing list
>Members@kalamazoolinux.org 
>
>_______________________________________________
>Members mailing list
>Members@kalamazoolinux.org
>