Asterisk, and other worldly endeavours.

A blog by Leif Madsen

bash creating files named ‘1’ everywhere!


So I ran into something kind of stupid today 🙂 Adding a little note for anyone who might run into a similar instance.

I have some ssh-add stuff that gets run in my .bashrc file, but when I was outputting it, I was doing:

ssh-add ~/.ssh/some_key > /dev/null 2&>1

Note the 2&>1 at the end. That means to redirect output to a file named 1. You need to flip the &> into >&, so the fixed version looks like:

ssh-add ~/.ssh/some_key > /dev/null 2>&1

Written by Leif Madsen

2012/07/19 at 10:03 am

Posted in Musings, Programming

Tagged with , , ,

One Response

Subscribe to comments with RSS.

  1. note that you should title this “bash creating files everywhere” or perhaps even more accurately “my bash script created files everywhere”.

    i don’t use bash, except for for loops, which is the one place it excels over tcsh.

    on another note, i don’t understand what you are doing with the ssh-add in your .bashrc to begin with? what is the purpose?

    Jon Daley

    2012/07/21 at 8:58 am


Comments are closed.

%d bloggers like this: