LinuxQuestions.org
Register a domain and help support LQ
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-25-2006, 03:12 AM   #1
gregorian
Member
 
Registered: Apr 2006
Posts: 509

Rep: Reputation: 34
Smile What is the use of shell programming?


I know Java and Dos batch programming.

Dos batch programming is not of much use unless you are the kind of guy who loves writing batch viruses.

I heard Shell programming is the Unix equivalent of Batch for Windows.

I want to know its capabilities and its use and its essentialness(if such a word exists) for a Linux Users.

I googled for Shell programming but only found lists of Unix commands.Any help will be appreciated.
 
Old 04-25-2006, 03:42 AM   #2
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
Just google for

"Why shell programming?"
 
Old 04-25-2006, 03:46 AM   #3
satinet
Senior Member
 
Registered: Feb 2004
Location: England
Distribution: Slackware 14.1
Posts: 1,469

Rep: Reputation: 46
Quote:
I heard Shell programming is the Unix equivalent of Batch for Windows
This is kind of true. However, the unix shell is far more powerful and flexible. Indeed many important parts of the unix/linux system operate through shell scripts. e.g. rc scripts.

A point to note that this is usually called "shell scripting" rather than shell programming, so maybe that's why your search results weren't too great.

take a look at this:

http://www.tldp.org/LDP/abs/html/why-shell.html

Shell scripting is very powerful. but like most langauges it has it's good and bad points. And things it is good for doing, and things it is not good for doing.

I would recommend the O'Reilly book "Classic Shell Scripting" if you are intersting in learning more.

This is very important if you want to learn about linux!
 
Old 04-25-2006, 03:52 AM   #4
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 57
Wow, so many answers. I use shell scripts to make tasks easier. There is a monster amount of CLI apps available for linux so you can do almost anything you want, example, rather than have to open a FTP client, find directories etc and upload a file to my site, I have a small shell script with my password encrypted in a file and it uses a CLI ftp app to upload a file I specify.

Random example but you can write scripts to make complicated tasks one-liners.
 
Old 04-25-2006, 03:53 AM   #5
zeitounator
Member
 
Registered: Aug 2003
Location: Montpellier, France, Europe, World, Solar System
Distribution: Debian Sarge, Fedora core 5 (i386 and x86_64)
Posts: 262

Rep: Reputation: 30
Quote:
Originally Posted by gregorian
Dos batch programming is not of much use unless you are the kind of guy who loves writing batch viruses.
This makes as much sense as saying "Microsoft office is not of much use unless you are the kind of guy who loves to write macro viruses" or even "a hammer is not of much use unless you are the kind of guy who loves to hit his fingers hard". Batch programming is very usefull, in dos, winxp shell or linux to automate repetitive tasks, fire automatic actions upon login or startup, make simple installers, write simple programs....

Quote:
Originally Posted by gregorian
I heard Shell programming is the Unix equivalent of Batch for Windows.

I want to know its capabilities and its use and its essentialness(if such a word exists) for a Linux Users.

I googled for Shell programming but only found lists of Unix commands.Any help will be appreciated.
Have a look at this guide for bash shell:
- http://www.tldp.org/LDP/Bash-Beginne...tml/index.html
- http://www.tldp.org/LDP/abs/abs-guide.pdf
 
Old 04-25-2006, 06:34 AM   #6
gregorian
Member
 
Registered: Apr 2006
Posts: 509

Original Poster
Rep: Reputation: 34
Thanks for the replies.I guess it answers all of my questions and now I'm gonna learn shell scripting.
 
Old 04-25-2006, 06:39 AM   #7
halturata
Member
 
Registered: Aug 2005
Location: Sofia
Distribution: SuSE, ELinOS
Posts: 100

Rep: Reputation: 16
Well, shell scripting is most usefull when you want to automate a particular sequence of commands you would otherwise have to type one by one on the prompt.As an example a lot of your Linux box startup is performed with shell scripts, i.e. loading of modules mounting of filesystems, starting of processes, etc. Shell scripting is also used in some programming environments to assign specific environment variables which are then used as a reference by compiling or running a program. And these are only some of the possible appliances of scripting.
As satinet mentioned above, it is very important to understand and to be able to write shell scripts if you want to learn the depths of Linux.
So I advise you to take a look at the manuals on www.tldp.org

Good Luck!
 
Old 04-25-2006, 07:02 AM   #8
mjjzf
Member
 
Registered: Feb 2004
Location: Valby, Denmark / Citizen of the Web
Distribution: Slackware 14.1
Posts: 879

Rep: Reputation: 39
It is mostly useful if you service many PCs or a server - to simplify recurring tasks. A good place to learn is Linux Command.
 
  


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 programming qerf Linux - Newbie 9 11-12-2005 06:27 PM
new to shell programming bluetwist Debian 3 08-01-2005 04:56 PM
Shell Programming eantoranz Linux - Networking 2 06-02-2005 12:21 PM
shell programming shadowsurfer Linux - Newbie 3 09-09-2004 10:40 PM


All times are GMT -5. The time now is 10:22 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