CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner: Executing linux command in a perl script: Edit Log

New User

Jul 8, 2013, 12:50 PM

Views: 1502
Executing linux command in a perl script

I'm a beginner and I have to write a script that extract data from a website.
The data structure is the following:
region > river > station > date > 01.07.2013.csv
region, river, station, date are directories and 01.07.2013 is a file containing informations

the problem is,
a station has the name : ELBE+(ARTLENBURG)
and when my script executes this command : `bash -c 'ls -r $s'`
$s is a variable containing the path of the directory having the name of this region:
I get the following error:

bash: -c: line 0: `ls -r ./pegel/ELBEGEBIET/ELBESEITENKANAL/ELBE+(ARTLENBURG)'
bash: -c: line 0: syntax error near unexpected token `('

you can find the script I wrote as attachment.
and If you have any critics, or you see that I made some errors please tell me how to correct them
I really need your help :(
I have no idea how to fix this error, and I have to fix it as soon as possible.
Thank you very much, and I m sorry for the spelling errors I don't speak english very well

(This post was edited by yosr on Jul 8, 2013, 2:13 PM)
Attachments: extractData.plx (4.80 KB)

Edit Log:
Post edited by yosr (New User) on Jul 8, 2013, 2:13 PM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives