Thursday, September 25, 2008

Pipe stderr to another process

In bash, suppose you want to save stdout to a file, but you want to pipe stderr to another process.
Here's how:

> myprocess 2>&1 > file.out | error_processor

This way of doing things in bash has always confused me, because it seems like you're putting stderr into stdout, then saving stdout in file.out. But it's backwards. Similarly, if you do

> myprocess > file.out 2>&1

you save both stderr and stdout to file.out. Counterintuitive!

Thursday, September 18, 2008

Tuesday, May 13, 2008

FVWM window changing

The FVWM wiki has the magic incantation to make Alt-Tab do what you want. Since I'm using X11 in a single window in Windows, I replace the final line with "Key Tab A CM SwitchWindow" to change windows within X11.


SetEnv DIR Next


AddToFunc FocusRaiseAndStuff
+ I Iconify off
+ I Focus
+ I Raise

AddToFunc SwitchWindow
+ I $[DIR] (CurrentPage, !Iconic, !Sticky) FocusRaiseAndStuff
+ I Deschedule 134000
+ I PipeRead `[ "$[DIR]" == "Prev" ] && \
echo 'SetEnv NDIR Next' || \
echo 'SetEnv NDIR Prev'`
+ I Schedule 700 134000 SetEnv DIR $[NDIR]

Key Tab A M SwitchWindow

Monday, May 5, 2008

Making files executable in Perforce

[p4] unix file permissions

Wright, Richard richardw at cobaltgroup.com
Wed Oct 29 15:16:21 PST 2003
For this you need the "-t" option for p4 edit.  You need to open the file
for edit, adding "+x" to the filetype.

For example, if the Perforce filetype is text, and you wanted to make it
executable, you would to the following:
p4 edit -t text+x file
p4 submit

If the Perforce filetype is text+k, you would do:
p4 edit -t text+kx file
p4 submit

If it's a binary file:
p4 edit -t binary+x file
p4 submit

You can get the current filetype with 'p4 fstat file' and you can get more
info on file types with 'p4 help filetypes'

Rick Wright
CM/Build Engineer
The Cobalt Group
www.cobaltgroup.com