Reputation: 387
I have a very simple script that I'm trying to do a grep command in a bash script. It works on the command line but not in the script. I would greatly appreciate some assistance.
#!/bin/sh
echo "test 2";
grep 14784 logs/ftp_log.13-10-29 > test
It's called from a php page, it prints out the "test 2" but does not do the grep and create the test file, however when I run it from the command line it does without a problem. Any help you could give would be appreciated.
Thank you, Dave
Upvotes: 1
Views: 354
Reputation: 158190
Sounds like a file permission problem. Make sure that the file test
exists and the web server user has proper permissions to write to that file
Upvotes: 1