• RSS
  • SmsJobs
  • Sms
  • GoogleBuzz
  • Facebook
  • Twitter
  • Linkedin
  • Youtube
The Linux Juggernaut

The Linux Juggernaut

roles on……

Do you like www.linuxnix.com ? Please consider supporting us by becoming a subscriber and get a Linux basics e-book for free.
windows-os-vs-linux-os
When I started my career in IT field, I have landed into windows world, as I know that no companies give chance to a fresher to work on production Linux/Unix servers. Its a good experience to work on DOS scripts(aka Batch programming). There are many similarities/differences/advantages/disadvantages between Batch programming and Shell scripting. Lets see what they are.

Similarities

Sl.No Batch programming Shell script
1 Sequential execution of  group commands in a batch file Sequential execution of  group command in shell scripts
2 Can read inputs from users Can read inputs from users
3 Has control structures such as for, if, while, switch for better automating/scripting Has control structures such as for, if, while, switch for better automating/scripting
4 Supports advanced features such as Functions and Arrays Supports advanced features such as Functions and Arrays
5 Supports regular expressions(using findstr) Supports regular expressions
6 Can include other programming codes such as perl(ie.. in middle of dos script we can include some other programming language code for effective scripting to get our desired output) Can include other programming codes such as Perl, AWK, SED etc.



Differences
Sl.No Batch programming Shell script
1 Lack of richness of tools/commands Have good number of tools(as of my knowledge there are more than 75000 commands in Linux/Unix)
2 Supports only one vendor(i.e. windows) Supports for number of vendors such as Sun/apple/IBM AIX/HP-UX/GNU Linux etc.
3 No other variants for DOS There are number of variants such as bash, ksh, csh, zsh etc..
4 Low capabilities of integrating with other programming code in batch scripting Good capabilities of integrating other programming code in shell script
5 Cannot handle complex regular expressions Can handle complex regular expressions.
6 A batch file should always end with .bat There is no such concept like file extension, but a shell script file permission should be set to executable.
7 To execute a batch program just enter the file name at CLI To execute a shell script, here are the ways to execute it
1)chmod +x shellscript.sh;./shellscript.sh
2)sh shellscript.sh


Good article on how to convert your Batch program to a Shell script.
http://tldp.org/LDP/abs/html/dosbatch.html
Do you like www.linuxnix.com ? Please consider supporting us by becoming a subscriber and get a Linux basics e-book for free.
bySurendra On Thursday-January - 28 - 2010

Categorie

Basics, Scripting

Tags

,

If you liked this article, you might like these as well..

  • HautDawg

    Hi Surendra Doing a good job ‘evangelising’ Linux – you seem to be quite knowledgable about it, too.Good job!

email newsletter

Redhat Flagship dist

Redhat announced that they are going to release RHEL7 by ...

12 examples to use f

Flower brackets examples This is a small post on how to ...

7 Linux read command

read command examples read command is useful in scripts when reading ...

7 linux sort command

Linux/Unix sort command examples This is a small tutorial on how ...

How to find command

How to find command location in Linux and Unix This is ...

  • About Linux Juggernaut

    How the blog name selected? Juggernaut: * a massive inexorable force that seems to crush everything in its way ...readmore>>

  • Contact Me

    Contact us Send an Email Phone number and vCard LinkedIn profile Advertise with us
  • About Me

    Surendra Kumar Chowdary

    My name is Surendra Kumar Anne. I am from Vijayawada which is cultural capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. At present i work at Persistent Systems as Module Lead.   read more »