LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Best Scripting Language for beginner : Bash vs Python vs Perl (https://www.linuxquestions.org/questions/linux-newbie-8/best-scripting-language-for-beginner-bash-vs-python-vs-perl-4175534821/)

sriram91 02-22-2015 08:52 PM

Best Scripting Language for beginner : Bash vs Python vs Perl
 
I have reasonable experience in linux based systems. I want to learn a scripting language , can anyone out there suggest which one is the best to start with ? I would be grateful if anyone can provide me with links / books references as well ...

grail 02-22-2015 09:40 PM

Best like most things would be in the eye of the user. Generally the best tool for the job is a better way to go.

In the case of learning I would probably say Perl as you will learn not only about scripting but hopefully good habits too which can then be applied to the others.

As far as references go, really searching will return plenty and some will appeal and others not, but here is one:

http://www.perl.org/books/beginning-perl/

veerain 02-23-2015 04:41 AM

Bash is good shell scripting language.

You definitely should learn a shell plus

Perl or Python

Both are good.

Perl has many external modules through CPAN.

Python is more at news these days.

pan64 02-23-2015 05:34 AM

it was discussed several times: http://www.linuxquestions.org/questi...ipting-886094/, but first you need to learn bash (if you are not familiar with it)

http://www.linuxquestions.org/questi...2/#post5316361

RobInRockCity 02-23-2015 09:52 AM

Newest Newbie here.

What exactly would you use Perl or Python for in Linux?

All I know is that "Shell" is a program that takes commands from the keyboard and sends them to Linux for processing. And the totality of my shell knowledge is how to access my VPS using SSH and how to copy a file to another directory while maintaining its original modified date!

I guess I don't really understand what shell is sued for besides simple one-off commands.

It is pretty hard for me to figure out where Perl or Python would come in?! :confused: (I am a programmer by nature, and used to building websites. When I think of something like Python, I think of building an e-commerce or social media website...)

Sincerely,


Rob

pan64 02-23-2015 10:25 AM

actually a shell script is a collection of commands to execute them automatically without typing them again and again. but of course it can do a bit more (not only execute commands), because it has variables, redirection, loops and a lot of other features.
Sometimes the capabilities of the shell are not really enough. python, perl and several other languages are more powerful, so you can implement much complex logic or workflow.

DavidMcCann 02-23-2015 10:33 AM

As has been said before, bash is essential (especially at work) because it's always there, but you can't be sure of having Python or Perl.

The only home-made bits of bash that I have are scripts, one for for backing up, and one that runs at boot and removes flash cookies (evil!), thumbnails (they breed like wire coathangers), and gvfs-metadata (ditto).

http://tldp.org/LDP/abs/html/
shows a lot of things done with bash, ranging from finding the days between two dates, through making a dictionary, to an implementation of the game of Life.

fatmac 02-23-2015 01:20 PM

Basically, the shell runs O/S commands in various ways, whilst Perl, Python, LUA, etc, are (non compiling) programming languages, they are often used to create one off GUI programs, using GTK, QT, FLTK, etc.

A knowledge of shell scripting can take you a long way; non compiling languages are easier to debug than compiled code like C, C++, Assembler, etc.

This may be of interest, http://www.perlmonks.org/

sriram91 02-25-2015 04:09 PM

Thank you all for your valid suggesstions and for the links shared it was very helpful.

dugan 02-25-2015 04:13 PM

BASH.

Python and Perl should be thought of as programming languages, and they are not used for the same things as BASH. Yes, technically they are "scripting languages", but "scripting language" this context does not mean "language used for shell scripting."

joe_2000 02-28-2015 12:38 PM

I personally try to do as much as I can in bash, because I like to have scripts with minimal dependencies. As previously said, on a Linux system you can reasonably expect to have bash available.

However, if you also want to be able to use your stuff on Windows, perl / python are easily portable, while bash is a bit more complicated...


All times are GMT -5. The time now is 01:26 PM.