BASH redirect & grep -v help needed
dave selby
dave6502 at googlemail.com
Wed Feb 18 21:12:31 UTC 2009
> motion -c /home/dave/kmotion2/core/motion_conf/motion.conf 2>&1 | grep
> -v 'saved as' >> /home/dave/kmotion2/www/motion_output
>
> This will pipe both the stdout and stderr through grep. e.g. redirect
> stderr (file descriptor 2) to file descriptor 1 (stdout).
Many thanks :) Still having a bit of trouble though - have slightly
changed the code
dave at main-system:~$ motion -c
/home/dave/kmotion2/core/motion_conf/motion.conf 2>&1 | grep -v 'saved
to'
[0] Processing thread 0 - config file
/home/dave/kmotion2/core/motion_conf/motion.conf
[0] Processing config file /home/dave/kmotion2/core/motion_conf/thread01.conf
[0] Processing config file /home/dave/kmotion2/core/motion_conf/thread02.conf
[0] Motion 3.2.9 Started
[0] ffmpeg LIBAVCODEC_BUILD 3352064 LIBAVFORMAT_BUILD 3344896
[0] Thread 1 is from /home/dave/kmotion2/core/motion_conf/thread01.conf
[1] Thread 1 started
[1] cap.driver: "uvcvideo"
[1] cap.card: "UVC Camera (046d:08cc)"
[1] cap.bus_info: "0000:00:10.4"
[1] cap.capabilities=0x04000001
[1] - VIDEO_CAPTURE
[1] - STREAMING
[1] Supported palettes:
[1] 0: MJPG (MJPEG)
[1] 1: YUYV (YUV 4:2:2 (YUYV))
[0] Thread 2 is from /home/dave/kmotion2/core/motion_conf/thread02.conf
[2] Thread 2 started
[0] motion-httpd/3.2.9 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8080
[1] Test palette YUYV (352x288)
[1] Using palette YUYV (352x288) bytesperlines 704 sizeimage 202752
colorspace 00000008
[1] found control 0x00980900, "Brightness", range 0,255
[1] "Brightness", default 127, current 127
[1] found control 0x00980901, "Contrast", range 0,255
[1] "Contrast", default 32, current 32
[1] found control 0x00980902, "Saturation", range 0,255
[1] "Saturation", default 32, current 32
[1] found control 0x00980913, "Gain", range 0,255
[1] "Gain", default 0, current 0
[1] found control 0x08000000, "Backlight Compensation", range 0,2
[1] "Backlight Compensation", default 1, current 1
[1] found control 0x08000001, "Power Line Frequency", range 0,2
[1] "Power Line Frequency", default 2, current 2
[1] mmap information:
[1] frames=4
[1] 0 length=202752
[1] 1 length=202752
[1] 2 length=202752
[1] 3 length=202752
[1] Using V4L2
Thats what I want outputed to a file
dave at main-system:~$
dave at main-system:~$
dave at main-system:~$
dave at main-system:~$ motion -c
/home/dave/kmotion2/core/motion_conf/motion.conf 2>&1 | grep -v 'saved
to' >> xxx.out
dave at main-system:~$
dave at main-system:~$
dave at main-system:~$ cat xxx.out
dave at main-system:~$
So any idea why xxx.out contains zsip instead of the above ?
Cheers
Dave
More information about the ubuntu-users
mailing list