-   Linux - Software (
-   -   Perl help (

kaoticsnow 12-20-2010 06:40 PM

Perl help
I'm having a bit of trouble with a perl script, I'm getting command not found errors when trying to define variables:


# Set behaviour


I get the following errors when exicuting:


./ line 9: =/home/cisco/bkup: No such file or directory
./ line 10: =RW_STRING: command not found
./ line 11: = command not found
./ line 12: =30: command not found
./ line 15: =/RTR_LIST: No such file or directory
./ line 16: =/storage: No such file or directory
./ line 17: =/LATEST: No such file or directory
./ line 18: =/PREV: No such file or directory

I'm also getting errors about the working directory not existing, but it does:


[mon01 bkup]# pwd


AlucardZero 12-20-2010 07:23 PM

How are you executing it? Does it behave different with "perl" ?

kaoticsnow 12-20-2010 07:53 PM

That was one problem, Thanks! now I just need to figure out why its not able to connect to the device and pull the backups. but thats another issue I believe.

AlucardZero 12-20-2010 08:42 PM

Ok, so it sounds to me like you were trying to execute this perl script as a shell file. According to the shell, $workingdir would be empty, so the first non-comment line would be "=/home/cisco/bkup" which of course is not a valid commmand.

Assuming /usr/bin/perl exists, chmod'ing the file +x and running ./ should work. And so will "perl" without having to set it executable.

kaoticsnow 12-20-2010 08:45 PM

I already chmod'ed the file +x but it made no difference, theres no problem simply executing it with the Perl command but I'm probably going to ditch the script anyway, as I can not get it to actually pull down the configs from my cisco devices.

All times are GMT -5. The time now is 11:48 AM.