LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-17-2007, 02:50 AM   #1
ratul_11
LQ Newbie
 
Registered: Dec 2005
Posts: 29

Rep: Reputation: 15
why this script is running in bash but not in perl


A script that will show system time,language&country information and system information.


Dear All I have written the following small script in bash it is running successfully.
#!/bin/bash
date
uname -a
cat /etc/sysconfig/clock | grep ZONE
locale | grep LANG

But when i am writing the same script in PERL the
" cat /etc/sysconfig/clock | grep ZONE"-- this line is not executing and showing sh: /etc/sysconfig/clock: Permission denied in the screen.The other three lines are executing successfully.

I made chmod + x prog.name before executing the script and I also tried to run the script as a regular and root user.But in both cases the o/p are same. If there is any modification can be made to the script to work in more details pls give that suggestion also.

Thanks & Regards
Anirban.
 
Old 08-17-2007, 08:30 AM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 32
bash and Perl are two separate languages. Each has its own syntax. You can't ask Perl to understand a bash script.
 
Old 08-17-2007, 09:31 AM   #3
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
post the Perl code.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
passing variable from bash to perl in a bash script quadmore Programming 6 02-21-2011 04:11 AM
Perl error in a Bash script rujin69 Programming 2 03-26-2007 02:40 PM
Help: Perl or Bash Script help embsupafly Programming 1 08-11-2005 06:01 PM
perl/bash script to monitor all processes running in my machine pudhiyavan Linux - Security 4 07-19-2005 02:09 PM
Embedding perl in bash script MikHud Programming 4 02-02-2005 06:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:31 PM.

Contact Us - Advertising Info - Rules - Privacy - Donations - Contributing Member - LQ Sitemap - "Weather apps tell you it'll rain. Wyndo tells you when to go."
Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions