Should I Learn Bash or Perl?



Should I Learn Bash or Perl?

Should I Learn Bash or Perl?

Should I learn Bash or Perl? I don’t know which one to learn.

Some people think Bash is the only real choice for shell scripting.

Do you think that?

Bash is Unix only. You cannot use Bash on a Windows or Mac.

And Perl is portable.

That’s true, since you can write code for almost any OS using Perl, including Unix.

Then why do so many people avoid bashing Bash if it is so limited?

Bash scripts are one of the best choices for funneling data from other apps to the admin side or sending data from one app to another.

That sounds like something a Unix admin would do.

Bash is a Unix shell which contains a scripting language. You can input commands as well as control how they run.

And now we have the god-like sys-admin. Are there cases where one is better than the other?

Bash is better for filing handling. Bash can examine the contents of a file, like using the awk command to count the unique incidents of a combination like how many unique files someone pulled or printed.

Back to system admin.

Perl and Python are better for reading the content of files and manipulating information.

Perl is a much more general purpose language.

Bash is limited. If you start making it too complicated, it becomes simpler to create a program in Perl or Python.

Which one is easier?

Shell scripting in either language is simple. If you want to do a task not related to the shell, use Perl or Python.

Any other ideas?

Well, you could learn Python, too, for admin scripts.

I’d rather bash my head against the wall learning Bash.

That’s more likely to cause you to forget it, than learn it.

Comments are closed.