Shell scripting vs Perl scripting


 
Thread Tools Search this Thread
The Lounge What is on Your Mind? Shell scripting vs Perl scripting
# 8  
Old 08-30-2010
Furthermore, you'll probably be using BASH or KORN to run your perl scripts, so you might as well learn to use it.
# 9  
Old 08-31-2010
shell scripting before perl

Shell scripting will allow you to quickly perform more involved commands. And, you will more naturally learn as you chain one process into the next. For instance, you probably already know the ls command, but you can combine it with other commands to get (perhaps) better info. Thus, you could ls | grep "smith" to find filenames with "smith" in them. Next, you might decide to do a loop around those results to determine whatever.
Anyway, shell scripting is simply an extension of the shell commands.

So... I would start with shell scripting.
# 10  
Old 08-31-2010
learn them both but learn shell scripting first. I suggest sh or ksh first and then bash. This will allow you script easily on systems that don't have bash. learning Perl after will allow you to appreciate the language.

and don't forget about basic sed/awk/grep.
# 11  
Old 09-04-2010
for system administrators i would suggest Perl because of its portability.
# 12  
Old 09-05-2010
I would say learn both of them and when using
" use the right tool for the right job Smilie "
# 13  
Old 09-06-2010
Quote:
Originally Posted by joeyg
Shell scripting will allow you to quickly perform more involved commands. And, you will more naturally learn as you chain one process into the next. For instance, you probably already know the ls command, but you can combine it with other commands to get (perhaps) better info. Thus, you could ls | grep "smith" to find filenames with "smith" in them. Next, you might decide to do a loop around those results to determine whatever.
Anyway, shell scripting is simply an extension of the shell commands.

So... I would start with shell scripting.
Agreed, and Frank, you too.

find /my/dir -maxdepth 1 -type f -not -name *bz2 -exec bzip2 {} \; FTW baby!

None of this ls stuff, BASH is where the action is at.
And perl is where the trickiness is made do-able.

while (<>) {
if ($_ =~ /\S+ (\S+)\s+(\d+)/) {
print 'Index ' . $1 . ' has ' . $2 . ' functions.' . "\n";
}
}

Then mix them together:
find /my/dir -maxdepth 1 -type f -not -name *bz2 |my_perl.pl |grep -i "fancy" |awk '{ print ( $4 }' |less

Feel the powers for different tasks...

I mean lets be honest you cannot sys admin without BASH (or SH/KSH)

Last edited by STOIE; 09-06-2010 at 02:01 AM..
# 14  
Old 09-06-2010
BASH has regular expressions these days, you know. No need to run 2 or 3 interpreters to do one job.
This User Gave Thanks to Corona688 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Web Development

Perl scripting or shell scripting?

i am going to study any one of the scripting languages mentioned above(shell 0r perl scripting) . Which is having more scope for a fresher? (1 Reply)
Discussion started by: Anna Hussie
1 Replies

2. What is on Your Mind?

Shell Scripting vs Perl scripting

Gents, I have been working in a Solaris/Unix environment for about 9 months. I took some linux classses online before getting the job. But, I am not very good at scripting. I want to learn how to script. Do you think that I should start with Shell scripting or Perl? I wanted to continue with... (2 Replies)
Discussion started by: Pouchie1
2 Replies

3. Android

Android Scripting Environment: Shell Scripting and Android

I just upgraded to Android 2.2 from 2.1. The GPS issue that was troublesome in 2.1 seems to have been fixed. Some of web browsing seems faster, but it could just be my connection is better today ;) Flash works in some browsers but not very good and it is too slow for Flash apps designed for... (0 Replies)
Discussion started by: Neo
0 Replies

4. Shell Programming and Scripting

Conversion from Perl to Shell scripting

Hai ! I am doing a research on Bioinformatics and a part of the code in perl have to be converted to shell scripting. I am new to shell programming. Pls. kindly help me to convert this code to shell script though it is somewhat lengthy. PLS KINDLY HELP ME. THANKS IN ADVANCE. my @FreeEnergy =... (1 Reply)
Discussion started by: kswapnadevi
1 Replies

5. Shell Programming and Scripting

Linux/Unix shell scripting vs Perl

Hi, I have general question: i have good working Perl script with .pl extension, and now I have to migrate all to another Linux box, and I was told that I can use only shell scripting, so I'm not sure how different those two things are, will it work without any changes . Is there anything smart I... (6 Replies)
Discussion started by: trento17
6 Replies

6. Shell Programming and Scripting

Call Shell scripting from Perl Scripting.

Hi How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies

7. Shell Programming and Scripting

Comparison of two files which contains strings using Shell scripting or PERL

Hi, I need sample code to compare the two files line by line which contains text strings and to print the difference in the third file. Thanks in advance (1 Reply)
Discussion started by: sudhakaryadav
1 Replies

8. Shell Programming and Scripting

Should I use PERL or Shell scripting?

Hello, I have done some BASIC shell scripting/PERL scripting before so I am familiar with the languages. I am not really sure which one would lend itself better to the application I have to write. I am required to scan the message logs for possible break in attempts. If I use shell scripting... (3 Replies)
Discussion started by: mojoman
3 Replies

9. Shell Programming and Scripting

Comp-3 conversion possible with Shell Scripting or PERL?

I guess the subject asks it all, but I am wondering (before I go and code a COBOL module) if conversion of regular ASCII data to COMP-3 is possible on a UNIX environment (AIX 5.1)? Any help would be appreciated! Thanks, Dave (13 Replies)
Discussion started by: dfran1972
13 Replies

10. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies
Login or Register to Ask a Question