From: Cisco_King on


Hi Guys,
Generally it is considered hard to write scripts. But it's not that
difficult. Here is an interesting article which

explains how to write scripts in a very simple way. A must read

http://www.knowurtech.com/linux/writing_scripts.html

In general also i found this site quite interesting.
Cheers!!
Dinesh

From: Dan Espen on
Cisco_King <dineshaggarwal(a)gmail.com> writes:

> Hi Guys,
> Generally it is considered hard to write scripts. But it's not that
> difficult. Here is an interesting article which
>
> explains how to write scripts in a very simple way. A must read
>
> http://www.knowurtech.com/linux/writing_scripts.html
>
> In general also i found this site quite interesting.

Really?

Learn to write scripts as root,
what a concept.

Lots of errors there too.
From: Rich Leitner on
On Mon, 15 Oct 2007 09:32:33 -0400, Dan Espen wrote:

> Cisco_King <dineshaggarwal(a)gmail.com> writes:
> ....blatant attempt to increase hits to his own website deleted ...
>


> Really?
>
> Learn to write scripts as root,
> what a concept.
>
> Lots of errors there too.

Okay, I'm a bit new to shell scripting but learning. What's wrong with
writing a shell script as root so long as the script does not have root
privileges itself? There was very little about this in the 3 or 4 books I
have been using to learn shell scripting, so I'm wondering if I (or they)
missed something. No, I won't go to Dinesh's site that shall remain
nameless to find out! Thanks ...

Rich
From: Bit Twister on
On Sun, 21 Oct 2007 23:02:58 GMT, Rich Leitner wrote:
>
> Okay, I'm a bit new to shell scripting but learning. What's wrong with
> writing a shell script as root so long as the script does not have root
> privileges itself?


Shell scripts execute with the privs of the user running them.
From: Dan Espen on
Rich Leitner <Rich(a)noyoudont.com> writes:

> On Mon, 15 Oct 2007 09:32:33 -0400, Dan Espen wrote:
>
>> Cisco_King <dineshaggarwal(a)gmail.com> writes:
>> ....blatant attempt to increase hits to his own website deleted ...
>
>> Really?
>>
>> Learn to write scripts as root,
>> what a concept.
>>
>> Lots of errors there too.
>
> Okay, I'm a bit new to shell scripting but learning. What's wrong with
> writing a shell script as root so long as the script does not have root
> privileges itself?

Unless you are perfect, your scripts will have errors.
If you write and test them as root, the simplest coding error
could wipe your whole system.

Write scripts as a regular user and never test scripts with live
data. Only after you are sure it is working do you run it with
live data or as root.