• 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

Linux_theme_of_the_month

Introducing theme of

Update1:As of now we started with RHCE concepts and in future we ...

Linux Bash Shell sho

This is a small post on improving your productivity when working with ...

Up coming posts on D

We are very much happy to announce that we started posting on ...

Wishing you Happy an

Dear Friends/Readers, I take this opportunity to convey our sincere thanks ...

sticky bit unix, unix sticky bit, suid, linux sticky bit, sticky bit in unix, sticky bit aix, sticky bit chmod, sticky bits, sticky bit linux, suid sgid sticky bit, set sticky bit, stickybit, sticky bit permission, setting sticky bit, solaris sticky bit, sticky bit solaris, sticky bit directory, remove sticky bit, ubuntu sticky bit, sticky bit t, aix sticky bit, sticky bit load balancer, directory sticky bit, umask

What is a sticky Bit

What is a sticky Bit and how to set it ...

SGID_Linux

What is SGID and how

What is SGID and how to set SGID in Linux/Unix? This ...

  • 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 »