ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I am having problems opening this script on my machine. i have been getting help from a very helpful person on this list.
I have checked the shebang line, that perl exists, and perl -v gives proper output.
i try to run the script below as follow:
[root@cctv httpd]# cd cgi-bin
[root@cctv cgi-bin]# ls -la
drwxr-xr-x 2 me root 4096 Mar 5 21:49 .
drwxr-xr-x 5 me root 4096 Mar 3 01:50 ..
-rwxr-xr-x 1 me root 268 Mar 4 13:50 printenv
-rwxr-xr-x 1 me me 1792 Mar 5 15:20 renamer
-rwxr-xr-x 1 me me 1788 Mar 4 16:40 renamer.cgi
-rw------- 1 root root 1731 Mar 5 21:49 renamer.pl
-rwxr-xr-x 1 me root 757 Mar 3 01:50 test-cgi
[root@cctv cgi-bin]# renamer.pl &
[root@cctv cgi-bin]# bash: renamer.pl: command not found
#The above instructs renamer to look for files called image.jpg in /home/httpd/htdocs.
#It checks once per minute for such a file to appear. If it sees a
#readable file called /home/httpd/htdocs.jpg it moves it to
#/home/httpd/htdocs/image.200302251530.jpg where the number is a
#time stamp with year (four digits), month, day of the month, hour (in
#24 mode), and minute.
#Read the bugs section closely.
#The original and new directories must be on the same file system.
#The program probably does not work on windows systems.
#The daemon behavior is weak.
#Not much testing has been done, so the script may have other problems.
You said there was an error.... Is there an error message? If not, what is the script actually doing (if it's not renaming to date format as you wanted it to)? If the script is running in the background, how did it get started running if you didn't start it running?
I assume you solved the earlier problem with execution permissions?
Did you write this script, or did you get it from somewhere else? If you wrote it, perhaps it would be good to consult a perl reference.