BASH redirect & grep -v help needed
John Hubbard
ender8282 at yahoo.com
Wed Feb 18 22:33:20 UTC 2009
dave selby wrote:
> Hi All,
>
> I am trying to get the standard output and error streams to be
> filtered so that any output with the string 'saved as' is discarded
> and the rest is appended to /home/dave/kmotion2/www/motion_output
> Me and BASH just do not get on, I have tried
>
> motion -c /home/dave/kmotion2/core/motion_conf/motion.conf &> | grep
> -v 'saved as' >> /home/dave/kmotion2/www/motion_output
> bash: syntax error near unexpected token `|'
>
>
This is kind of a work around but try making a script called myMotion
#!/bin/sh
motion -c /home/dave/kmotion2/core/motion_conf/motion.conf | grep -v
'saved as' >> /home/dave/kmotion2/www/motion_output
Then call myMotion to run the command. This should be especially useful
since you don't have to type in that long command every time you restart
the system.
--
-john
To be or not to be, that is the question
2b || !2b
(0b10)*(0b1100010) || !(0b10)*(0b1100010)
0b11000100 || !0b11000100
0b11000100 || 0b00111011
0b11111111
255, that is the answer.
More information about the ubuntu-users
mailing list