All Questions
6 questions
1
vote
1
answer
1k
views
Grep from bash return No such file or directory but work if the same command executed manually from CLI
If i execute below bash script named test.sh, I receive this error:
./test.sh: line 8: grep -irl -e"1234567891" ./save: No such file or directory
If I execute the line above taken from ...
0
votes
1
answer
958
views
grep unexpected behavior when [0-9] pattern is given on ubuntu [duplicate]
When I use [0-9] pattern to search for all numbers in a file, whether to use or not use single/double quotes around the pattern produces different outputs.
$ cat numbers
this line has 3
this line has ...
1
vote
1
answer
659
views
HTTP logs using tcpflow with grep, redirecting to a file don't work (empty file)
I want to log some specific HTTP requests that have a keyword, that are coming to a specific port. tcpflow works fine, but I can't write filtered results to an output file.
I don't understand why ...
5
votes
1
answer
4k
views
Redirect grep out to a file does not work [closed]
I am doing a recursive grep by the following command:
grep -r "load" . > tmp.txt
However, when I hit enter, the command does not execute and bash is waiting for more inputs..
My OS is Ubuntu 12....
2
votes
0
answers
744
views
exit code of grep in trap where the script is launched by upstart service
Recently I encountered a problem in ubuntu upstart and trap in Bash shell.
I use ubuntu 12.04. The upstart script(/etc/init/player.conf) is:
start on (local-filesystems and runlevel [2345])
stop on ...
5
votes
1
answer
2k
views
How can I act on the results of the "locate" command?
I'm trying to find where check_dns is defined in nagios' commands.cfg file, although there are quite a few files.
I know I could run something like find / -name "command.cfg" -exec grep check_dns {} \...