LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-23-2007, 05:56 AM   #1
jags.singh
LQ Newbie
 
Registered: Jun 2007
Posts: 5

Rep: Reputation: 0
Unhappy Perl:Not able to execute command in variable


Hi
When I am running command directly on the shell its working file but using variable it giving me error.

Could you please help me resolving the issue.

test1="rsh -l abuild 192.168.1.1 \". /E*Fare/profile; hostname -i\""


$ echo `$test1`
error:- bash: . /E*Fare/profile; hostname -i: No such file or directory

Last edited by jags.singh; 07-23-2007 at 06:42 AM.
 
Old 07-23-2007, 07:51 AM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,458

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
I don't really understand why you're going to do that in this way, but trying to remove the escaped double quotes should solve the problem, e.g.
Code:
test1="rsh -l abuild 192.168.1.1 . /E*Fare/profile; hostname -i"
Cheers
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl - execute external programme armandino101 Programming 5 12-15-2006 06:38 PM
perl @INC variable nodger Programming 3 07-10-2006 11:17 PM
Problem with perl script using a variable from a unix command. abefroman Programming 1 05-11-2006 05:11 PM
Apache 2 does not execute Perl! mesh2005 Linux - Networking 1 10-26-2005 10:51 PM
Why cant i execute a perl script dude4you Linux - Newbie 2 03-02-2004 05:50 PM


All times are GMT -5. The time now is 03:32 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration