Asterisk, and other worldly endeavours.

A blog by Leif Madsen

bash creating files named ’1′ everywhere!

with one comment


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
About these ads

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


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 1,600 other followers

%d bloggers like this: