• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unix Shell Scripting  RSS feed

 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can someone tell me how are the basic UNIX commands different from a UNIX shell script and give some examples as where we we can use shellscripts?

Thanks.
 
Joe Ess
Bartender
Posts: 9439
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A shell script is a text file of shell directives and programs for the shell to execute. It's basically the same thing as a batch file (.bat or .cmd) in Windows.
Have a look at the Bash Guide for Beginners for an introduction.
 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Joe.. I will look at it. From my understanding, it's UNIX commands written in a file. Is that correct?

Thanks.
 
Joe Ess
Bartender
Posts: 9439
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a little more to it as the shell provides for variables and flow control, but for the most part, yes, a shell script is a series of commands in a file.
 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Joe.
 
Harinath Kuntamukkala
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vi Editor Commands : How to Use the vi Editor
 
Tim Holloway
Saloon Keeper
Posts: 18793
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Unix/Linux command shell is essentially just the program that gets control when you log in. It operates as loop, reading command lines, parsing, them, and executing what it has found. The normal action for a shell is that any commands it doesn't understand internally will be looked up in designated disk directories (the PATH), loaded into RAM and executed with the parameters that the shell has extracted from the command line.

There are a number of shells commonly used these days, including bash, csh, ksh, ash, zsh, and others. Just to minimize confusion, they tend to adhere to certain conventions (such as the PATH environment), but technically they don't have to - any program can be designed to be a shell.

This is actually a more radical concept than it sounds. When I first started working with computers, the "shell" was an integral part of the OS and it couldn't be swapped out for a better one. Scripting, where possible, had to be done done using a special scripting program - the equivalent writing scripts in Perl or Phython these days.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!