15 Comments

bashrc

The ~/.bashrc is a the bash shells’ setting file. The ~/.bashrc can also be used to specify other bash shell related items like abbreviating commands and creating shortcuts. Here is my ~/.bashrc, all bells, no whistles.

About these ads

About Todd Partridge (Gently)

Good times, good people, good fun.

15 comments on “bashrc

  1. Sorry for a bit of OT, but can you upload a screenshot of what you expect this website looks like?
    On my browsers the field with the code is really narrow and scrolling doesn’t help much. If this is the way you want it, I would appreciate a link to a file I can download otherwise I have to copy the code (not a bit deal, it’s just a suggestion ;P).

  2. ha, ha, I understand. Yeah, if you have a high DPI monitor (or just like large text) I could see how this fixed-width blog template would “run-in” my code blocks. Ok, adding url to post.

  3. Same here. There seems to be a lot of wasted space under the terminal icon, but only for the code listing (?).

  4. Ah, I see. The terminal icon had a lot of empty space around it, got a new one instead.

  5. It looks a lot better now, thanks :-)
    Your previous posts e.g. http://linuxtidbits.wordpress.com/2008/08/11/output-color-on-bash-scripts/ looked fine but I didn’t associate the change with the icon – good catch, niico.

  6. Shouldn’t the return line be much higher?

    Here is mine for comments!
    https://github.com/kaihendry/Kai-s–HOME/blob/master/.bashrc

  7. @Kai

    Shouldn’t the return line be much higher?

    Yep, good catch. Fixed.

  8. 1. The man page says: “A value of ignoreboth is shorthand for ignorespace and ignoredups.” so you probably don’t need ignoredups.
    2. You missed an ‘e’ at the end of ‘human-readabl’.

  9. karol said:

    1. The man page says: “A value of ignoreboth is shorthand for ignorespace and ignoredups.” so you probably don’t need ignoredups.
    2. You missed an ‘e’ at the end of ‘human-readabl’.

    Ah, thanks for the info on ignoredups, I had missed that. As for readable, that was on purpose because I use 80 character-limited lines. Updated blog.

  10. > As for readable, that was on purpose because I use 80 character-limited lines.
    The ‘export PATH’ line seems to be 200+ characters long.

  11. karol said:

    The ‘export PATH’ line seems to be 200+ characters long.

    LOL, not sure what I can about that though :).

  12. Try putting each path entry on its own line, appending to the previous. Allows you to easily maintain the path order entries while keeping your column width limit. exports them all at the end with your path entries then the system profile path entries.

    unset _PATH
    _PATH=”$_PATH:$scrpt_dir”
    _PATH=”$_PATH:$scrpt_dir/root/backup”
    _PATH=”$_PATH:$scrpt_dir/bugfixes”
    _PATH=”$_PATH:$scrpt_dir/root”
    _PATH=”$_PATH:$scrpt_dir/root/debian”
    _PATH=”$_PATH:$scrpt_dir/root/gentoo”
    _PATH=”$_PATH:$scrpt_dir/root/arch”
    _PATH=”$_PATH:$scrpt_dir/root/testing”
    _PATH=”$_PATH:$scrpt_dir/others”
    _PATH=”$_PATH:$scrpt_dir/testing”
    export PATH=”$_PATH:$PATH”

    also you have multiple aliases with the same name (pasteit and turl).
    Thanks for the post. Learned a couple neat tricks.

  13. Reblogged this on Linux Tidbits and commented:

    Updated today, gotten better… redone.

  14. Environment variables such as PATH should not be in .bashrc as it is called each time a bash shell is executed (ie recursively). Similarly for tcsh / csh you do not put environment variables such as PATH in .cshrc. This is a common error

    Environment variables should be defined in .profile / .bash_profile / .login or their equivalent for whatever shell you are using. That way a sane system wide default can be set and added to if needed. In your example you have to use unset, which removes the system wide defaults, to get around the bug caused by putting your PATH definition in .bashrc instead of .bash_profile (etc)

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 )

Google+ photo

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

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 52 other followers

%d bloggers like this: