Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scripting recommendations 3

Status
Not open for further replies.

nogs

Technical User
Aug 3, 2001
89
GB
I'm pretty new to unix scripting and wondered what anybody thought was the best tool for the job - Perl, awk etc.
I will be carrying out text file editing and sys admin, any ideas!!!!!!
 
Well, the first question is "what other programming languages have you worked with?". Let's start where you are most familiar, and find the scripting language that resembles it the most.

For example, if you have worked with C-oriented languages before, such as C++, Java, PHP, even Javascript, then Perl will probably have a more familiar syntax than the others. This is where I came from, and I am sticking with Perl, since I realized it can do just about anything you would ever want in a Unix system. For really simple stuff, I occasionally use Bash.
 
I am in the process of learning Perl and C++. Can you use Perl alot with Windows?
And can you use C++ and Perl in Unix environment. If so how would the two differ?
 
Yes you can use Perl with Windows. See they have done some tremendous work to use port Perl effectively to a Windows setting.

Of course C++ and Perl can be used in Unix setting, that's where they were created! I recommend Perl for scripting stuff, though, and C++ only for applications you won't be changing often, or where you need to compile for more speed. The difference between C++ and Perl for scripting is that C++ is NOT a scripting language. It forces you to be a lot more strict about how you program, such as typing all variables, and you have to compile a tool before you can use it.

Perl is probably the most popular Unix scripting tool, and you will find it on just about every Unix system out there, so it's easy to take your admin scripts with you where you go. And there is an incredibly large library of Perl scripts out there you can browse to see examples of Unix system admin tools. (
Here is one of my favorite little Unix admin scripts in Perl: thread219-110247
 
reply to rycamor
I havnt had much programming expirience apart from basic shell scripts and would just like more guidance as to the next steps to take to develop my skills, I tried looking at - couldnt get it - is the name correct?
 
nogs,

is the correct URL, try it again - it was probably just a transitory error.

Perl is a good next step to improve your shell skills, it also has the advantage of being very portable. It's quite possible to write one script that will run pretty much everywhere that Perl will run.

There are other scripting languages as well, Ruby and Python spring to mind - but you don't want to go there... <grin> (actually, they're very good, but don't tell anyone I said do) Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Thanks for explaining the details about C++ and Perl. I am just learning both and just wondering what other Perl and C++ books you recommend? Also how many years did it take for you to get comfortable with both languages? I tried the Learning perl and perl cookbook but want something with more detailed scripting examples than the O'reilly books.
 
I am not a C++ programmer, so I can't help you in that department. As for detailed Perl scripting examples, just start searching the web for Perl tutorials, and you will find thousands of examples. Here's a good place to start:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top