LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-03-2006, 02:33 PM   #1
Annav
LQ Newbie
 
Registered: Apr 2006
Posts: 1

Rep: Reputation: 0
Shell script


When would a System Administrator use a shell script in a server environment?
 
Old 04-03-2006, 03:02 PM   #2
Dazed_75
Member
 
Registered: Oct 2005
Location: Arizona
Distribution: Debian, Ubuntu, Puppy, others
Posts: 36

Rep: Reputation: 16
I am not sure why you are asking this question (as in opposed to what?). But all administrators as well as many general users use shell scripts because they are quick to develop, modify, and test. They are also low overhead and fast compared to GUI applications. So for repetitive tasks and those that are to be automated (scheduled for execution), these are clear winners.

There are HUGE collections of them which are tried and true so often the only issue is to find one that fits. Even then, the search can take longer than creating your own except for complicated tasks that most other users of your type all have to do.

Hope this helps even though I have never learned System Administration though I have read a couple of books on it.
 
Old 04-03-2006, 05:54 PM   #3
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
Shell scripts are essential for practically everything in Linux, whether you're running a server or not. Even if you're not aware of their presence, they are running just about everything, so my answer is "always".
 
Old 04-03-2006, 05:58 PM   #4
demented_are_go
Member
 
Registered: Mar 2006
Distribution: Fedora Solaris Slackware
Posts: 50

Rep: Reputation: 15
I had to write two scripts recently, one of them was to pull info from syslog and create a report, the other was well, i had like six months worth of logs in one file, i needed that log to be split in daily logs, so I wrote a script to do it, that's much faster than doing it by hand.

Most scripts I've seen were to like, create users, create groups, check disks on servers, basically do anything you'd have to do repeatedly or as a part of your daily tasks. Personally I like to write my scripts with perl, since I'm not that great with bash yet, well I can do it, but perl's just easier for me.
 
Old 04-03-2006, 06:28 PM   #5
vls
Member
 
Registered: Jan 2005
Location: The grassy knoll
Distribution: Slackware,Debian
Posts: 192

Rep: Reputation: 31
Quote:
Originally Posted by Annav
When would a System Administrator use a shell script in a server environment?
Try this and see what you come up with:

Code:
for f in /sbin/* | grep script
do
file $f
done
 
Old 04-04-2006, 02:33 AM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
I maybe wrong, but I'd say that
Code:
for i in `ls /sbin/*`; do file $i|grep -i script; done
should be more accurate?

Your version gives 2 "scripts" for my sbin, mine gives 28.


Cheers,
Tink
 
Old 04-05-2006, 01:44 AM   #7
vls
Member
 
Registered: Jan 2005
Location: The grassy knoll
Distribution: Slackware,Debian
Posts: 192

Rep: Reputation: 31
Quote:
Originally Posted by Tinkster
I maybe wrong, but I'd say that
Code:
for i in `ls /sbin/*`; do file $i|grep -i script; done
should be more accurate?

Your version gives 2 "scripts" for my sbin, mine gives 28.


Cheers,
Tink
That's because I'm an idiot (bad transcription on my end).

Should be:

Code:
for f in /sbin/*
do
file $f | grep script
done
The point was to show the OP that he/she is using shell scripts whether they knew it or not.

Got a little too clever on my part.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script inside shell script treotan Linux - General 4 02-19-2009 06:34 AM
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 02:14 AM
Alias or shell script to confirm 'exit' commands from a shell rose_bud4201 Programming 2 03-08-2006 02:34 PM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
[SHELL SCRIPT] Write at the right of the shell window Creak Linux - General 2 04-02-2004 03:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration