LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 10-27-2004, 03:28 PM   #1
joeljkp
Member
 
Registered: Feb 2003
Distribution: Ubuntu
Posts: 41

Rep: Reputation: 15
Question Choosing a scripting language


I'm trying to choose a scripting language for a project here at work. I have a few requirements:

- easy-to-use argument handling features (script --option --option, etc.)
- robust text processing (writing out text files, inserting values into existing files, etc.)
- relatively simple to get off the ground for a semi-experienced programmer (with no OO xp)

I have a few languages to choose from:

- perl
- python
- tcl
- common shells

Unfortunately, I can only use these, since they are the ones installed on the systems here, and this script will be passed around, etc.

Any advice?
 
Old 10-27-2004, 03:48 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,854

Rep: Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121
someone asked abuot the exact same thing a few hours ago, but for the record... Perl. thing is that a moderate level of Bash (i.e. shell) should really be a given. at advanced levels the world is almost your oyster, but it's never *quite* as comprehensive as a full scripting affair like perl or python.
 
Old 10-27-2004, 03:53 PM   #3
joeljkp
Member
 
Registered: Feb 2003
Distribution: Ubuntu
Posts: 41

Original Poster
Rep: Reputation: 15
Are there argument-handling libraries and such for bash, or would I need to roll something myself?
 
Old 10-27-2004, 04:00 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,627
Blog Entries: 10

Rep: Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776
You'll get as many answers as there's members reading
this forum ;)


python: Clarity and easy to start

perl: Power & large existing codebase (and lots of
support here)

Both perl and python have plenty of modules,
including parsing libraries ...

Shell-scripts and Linux-tools: Hmmm ... may become
unwieldy and hard to maintain.

tcl: disgusting, nuff said :)




Cheers,
Tink
 
Old 10-27-2004, 04:31 PM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,854

Rep: Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121
perl has erm.. 4 different command line argument modules... getopts::short ::long and others... python or perl... your are so so so unliekly to find soemthign they can't do at this stage. perl even comes with webserver modules and all sorts of weird stuff. command line handling is a pretty trivial thing at the end of the day.
 
Old 10-27-2004, 04:36 PM   #6
wapcaplet
Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 45
I'd also add that if you go with a shell language like bash, you may have more portability (since practically every Linux install has bash; they don't always come with Perl or python), in exchange for slightly less power and versatility. Most text processing from bash will most likely have to be achieved via other standard utilities such as grep or sed, whereas with Perl it can be done more directly. And if you need to do any kind of arithmetic (other than integer), bash is probably not the right choice.

Bash has the builtin "getopts" command for parsing command-line options, and it's also fairly easy to just use a while-loop with a nested conditional statement to retrieve arguments, executing a "shift" after each to bring in the next argument.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Which Scripting Language? birdseye Programming 2 10-03-2005 09:54 AM
Choosing a Language for the Future? flamesrock Programming 25 08-06-2005 01:38 AM
Seeking for a good scripting language... Frank Programming 11 01-02-2004 10:35 PM
Favorite scripting language rverlander General 8 09-02-2002 05:06 AM
Choosing a language... dtaliafe Programming 7 01-23-2002 06:59 PM


All times are GMT -5. The time now is 08:39 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration