![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to run cmds after changing to a new env (shell) in a shell script | charlei | Shell Programming and Scripting | 6 | 10-14-2008 03:18 PM |
| Help! Need to convert bash shell to perl | freak | Shell Programming and Scripting | 0 | 06-19-2008 10:42 AM |
| Another bash shell to perl conversion | freak | UNIX for Dummies Questions & Answers | 6 | 05-29-2008 01:04 PM |
| Converting bash shell to perl | freak | UNIX for Dummies Questions & Answers | 4 | 05-29-2008 12:35 AM |
| What's the difference: 'nuhup cmds' Vs 'cmds &' | billshu | SUN Solaris | 5 | 05-12-2004 11:01 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Perl cmds doesn't work in Bash shell . Plz help
Hi everyone,
I have a Linux OS in my PC (older version 9). Its default shell is bash. Whenever I try to run some Perl program it throws error ! eg, if I run this simple PERL program , #!/usr/bin/perl printf "\lHello \n"; $var=3 ; printf $var; @list=(1,2,3); printf "@list"; ------------------------ it says - in Bash =3 command is not found and the last two lines have syntax error ! ![]() I tried it in cygwin also & got the same error (its default shell is also bash). But in my Office -PC, no error is observed. How to tackle with this situation? should I get the latest version of Linux on which PERL can run without error ? Please help. |
|
||||
|
first off :
change the shebang to be on the FIRST line of the perl script, in the first lefthand column. Second: If that does not work, then Code:
jmcnama> which perl /usr/local/bin/perl I am making up something here, use what your system says: Code:
#!/usr/local/bin/perl |
|
||||
|
Quote:
Thanks jim Which perl on my cygwin gives cygdrive/c/Perl/bin/Perl But even if I use this line I get the previously mentioned errors .! |
|
||||
|
The script is -
#!/cygdrive/c/Perl/bin/perl $var=3 ; printf $var; @list=(1,2,3); printf "@list"; --------------------------- the error i get in cygwin is - bash: = 3: command not found syntax error near unexpected token '1, 2, 3' |
|
||||
|
Make sure that path to perl is in your PATH variable.
Code:
perl -e 'print "hello world\n"; ' |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| shell script, shell scripting, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|