943,929 Members | Top Members by Rank

Ad:
  • Perl Discussion Thread
  • Unsolved
  • Views: 11897
  • Perl RSS
May 25th, 2006
0

Advantage of using shell(ksh/bash etc) compared to perl?

Expand Post »
Hi,

I understand the advantages of using perl over other shell programming techniques like sh,ksh,bash etc. I understand that perl is very powerful and advanced.

But, here, i want to know, if there is any situation, where in, we prefer to use the usual shell programming over perl? Any performance gain? Or any other advantage? I know that Perl can act in many ways that shell scripts cannot, such as in cgi scripts. But as far as acting on the system and its files, or acting only locally, it seems that shell scripts are more powerful?

Thanks
Nisha
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Nisha R is offline Offline
1 posts
since May 2006
May 29th, 2006
4

Re: Advantage of using shell(ksh/bash etc) compared to perl?

There is pretty much no reason to use shell scripting if you're guaranteed that your environment will have perl, unless that's what you happen to prefer. Except for maybe some really small stuff.
Team Colleague
Reputation Points: 1135
Solved Threads: 172
Super Senior Demiposter
Rashakil Fol is offline Offline
2,478 posts
since Jun 2005
Jun 5th, 2006
0

Re: Advantage of using shell(ksh/bash etc) compared to perl?

Ten lines of shell script is easier to maintain than 70 lines of perl.
It's also faster to develop.

Experienced sysadmins use shell scripts, then use perl/ruby/python when they cannot do whatever it is in shell coveniently or very well.

In practice what usually happens is that new sysadmins learn one thing really well and use it for everything. eg, perl or ksh. This practice is usually frowned upon in big companies where creating hard to maintain code is frowned upon. Hard to maintain code is what you often get when you push a facility to the very edge of it's capbilities - usually because you don't any other way to do it.
Reputation Points: 62
Solved Threads: 10
Junior Poster
jim mcnamara is offline Offline
179 posts
since May 2004
Jun 20th, 2006
0

perl vs Bash shell

It all depends on what you are trying to do

Sometimes what takes 100 lines in shell to do can be achieved by using a simple perl module !

Sometimes a single bash shell command can do the job for you neatly

so it depends on the usage and user.
Reputation Points: 11
Solved Threads: 3
Junior Poster in Training
chrisranjana is offline Offline
82 posts
since Jul 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC