LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Bash: Script with tail and grep (https://www.linuxquestions.org/questions/linux-general-1/bash-script-with-tail-and-grep-502120/)

Primsi 11-16-2006 02:15 AM

Bash: Script with tail and grep
 
I would like to make a script to check my maillog and I tried the following:

Code:

su -c 'tail -f /var/log/maillog | grep $1'
this doesn't seem to work. How can I pass the variable for grep to the script ?

Thx

blackhole54 11-16-2006 02:57 AM

Use double quotes instead of single quotes around your command.

Primsi 11-16-2006 05:30 AM

Works perfectly, thanks a lot.


All times are GMT -5. The time now is 10:24 PM.