Visit Our UNIX and Linux User Community


perl as lanuage of shells in unix


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting perl as lanuage of shells in unix
# 1  
Old 10-22-2002
perl as lanuage of shells in unix

hi, do shells in unix understand the language of perl?

learning perl will make u a ultimate shell programmer?

thanks
yls177
# 2  
Old 10-22-2002
Re: perl as lanuage of shells in unix

Quote:
Originally posted by yls177
hi, do shells in unix understand the language of perl?
No. Perl understands Perl.

You will see in many perl scripts that the first line of code is often something along the lines of :

Code:
#!/usr/bin/perl

This tells the shell script to use the perl parser for the perl script.

Quote:
Originally posted by yls177

learning perl will make u a ultimate shell programmer?
thanks
No. While Perl does contain a lot of similiarities to shell scripting, it is in it's own little world. If you want to be an ultimate shell scripter, then you should pick a popular shells such as Korn Shell (ksh) (heartily endorsed by Perderabo) or Bourne Again Shell (bash) and have at it. There are many reference guides on the net to shell scripting.
# 3  
Old 10-22-2002
which is the more widely use shell?
yls177
# 4  
Old 10-22-2002
I would venture to guess Korn Shell and bash. But the Bourne Shell (sh) is just about universal across most Unices.
# 5  
Old 10-29-2002
Quote:
Originally posted by yls177
which is the more widely use shell?
Use the Bourne shell. Avoid csh and its associates for programming (at least). On some systems (like SGI) sh is now a link to ksh, and you have to say #!/bin/bsh to get the unadorned Bourne shell. But if you want ksh's extended features, some of which are quite useful, make sure every platform that will run your program has it.

For interactive use, I prefer zsh (and have for around 8 years), but zsh changes the test syntax (from [ -f fred.txt ] to [[ -f fred.txt ]]) among other things, so for programming, I still use sh.
# 6  
Old 10-30-2002
to be completely honest with you i would learn perl, vi, and 2 of the basic shells (sh & ksh).


sh = is on every style of unix and or linux.
ksh = i like this one over any of the other ones. it doesnt have all the bells and whistles but it does the job everytime i need something done.

perl = consider it an extention to shell scripting in general. sometimes you will want to use sed/awk/grep/ls and so on and other times you will want to use perl to do those things. knowing both gives you the basic artillery you will be able to take anywhere with you.

shell scripting = a basic function i think everyone and there fetus should learn. altho i am not an uber shell scripter like some of the chaps on here, i know the basics adn a little more and it will get you far enuff to be able to bulit off of that.
# 7  
Old 10-30-2002
Quote:
Originally posted by Optimus_P
[B]to be completely honest with you i would learn perl, vi, and 2 of the basic shells (sh & ksh).
Pretty good advice. Until recently, I was using Perl and Ruby for just about everything. But a guy at work was doing things in shell scripts (using csh Smilie ), so I have moved back more toward sh/awk/sed/... for bits that don't need a sophisticated data structure, i.e., about half of my scripting.

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

UNIX shells scripting

Can someone help by advising hw to built myself strong on logic building in UNIX shell scripting. I find it very difficult Sent from my iPhone using Tapatalk (4 Replies)
Discussion started by: Vijaykannan T
4 Replies

2. UNIX for Dummies Questions & Answers

UNIX shells script to echo out the date value

I appreciate if someone answer this question for my learning purpose: Given a filename structure of a COUNTRY CODE, file type, date (YYYYMMDD) and two digit attempt number with an extension of ".dat", write a UNIX shells script to echo out the date value. Example: ... (1 Reply)
Discussion started by: shumail
1 Replies

3. Shell Programming and Scripting

perl/unix: script in command line works but not in perl

so in unix this command works works and shows me a list of directories find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt but when i try running a perl script to run this command my $query = 'find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt';... (2 Replies)
Discussion started by: kpddong
2 Replies

4. Shell Programming and Scripting

"UNIX Shells By Example" CD Files

hello All, I just purchased a used copy of "UNIX Shells by Example" by Ellie Quigley. The CD is not in the back. I googled the world but the files dont seem to be available for download anywhere. Does anyone out there have them. It would be much appreciated if someone can email them to me. ... (1 Reply)
Discussion started by: tag0519
1 Replies

5. Shell Programming and Scripting

ftp from windows to unix using a perl script on unix machine

i need to ftp a file from windows to a unix machine by executing a sript(perl/shell/php) from that unix machine.i can also use HTML and javascript to build forms. (3 Replies)
Discussion started by: raksha.s
3 Replies

6. UNIX for Dummies Questions & Answers

changing shells in unix (im using putty)

hi. im new here. im taking a UNIX OS class and im in need of some help how do i change my shell in UNIX? for homework i need to edit the tcshrc file (to include aliases) in my home directory but its not there. so i think switching shells will create the file. am i correct? I'm using PuTTy.... (1 Reply)
Discussion started by: alpha_centauri
1 Replies

7. UNIX for Dummies Questions & Answers

How do I know what type of shells are available in my Unix system?

How do I know what type of shells are available in my Unix system? Are there a single command or environment variable that can let me find that out? Best regards, John Chan (7 Replies)
Discussion started by: shuhang2
7 Replies

8. Shell Programming and Scripting

[PERL] Running unix commands within Perl Scripts

I understand that in order to run basic unix commands I would normally type at the prompt, I would have to use the following format system(ls -l); or exec(ls -l); But when I actually try to use the command, the script fails to compile and keeps telling me there is an error with this line. ... (1 Reply)
Discussion started by: userix
1 Replies

9. Shell Programming and Scripting

Switching shells in UNIX Scripts

Solaris Newbie here to scripting in UNIX/SOLARIS. What I am looking to do is, once the script is executed, switch to /bin/bash shell and continue to execute the script. The problem I run into is once the script switches to the Bash shell, the script stops, and does not execute the... (2 Replies)
Discussion started by: Scoobiez
2 Replies

10. UNIX for Dummies Questions & Answers

Good Unix Shells ?

Hey Guys i am new to Unix and i have downlaoded Cygwin for Windows and deleted it. I was just wondering is there any good shells like that for windows that just as good thanks for your time ][ce (1 Reply)
Discussion started by: IceCold
1 Replies

Featured Tech Videos