From: Ian Kelling Date: Sat, 21 Jun 2014 05:11:02 +0000 (-0400) Subject: various minor improvements X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=commitdiff_plain;h=82360189172fc2d6a6a2559c883c076abcf8a515 various minor improvements --- diff --git a/.bashrc b/.bashrc index 4ddbab9..e46de66 100644 --- a/.bashrc +++ b/.bashrc @@ -26,21 +26,9 @@ if [[ $SSH_CONNECTION ]] \ return fi -# Side note on ssh. -################### -## include files ### -################### - -for x in $HOME/bin/bash-programs-by-ian/repos/*/*-function; do - source "$x" -done - -source $HOME/bin/semi-private # so I can share my bashrc -source $HOME/path_add-function - @@ -50,6 +38,10 @@ source $HOME/path_add-function CDPATH=.:/a +# remove all aliases. aliases provided by the system tend to get in the way, +# for example, error happens if I try to define a function the same name as an alias +unalias -a + # remove gnome keyring warning messages # there is probably a more proper way, but I didn't find any easily on google unset GNOME_KEYRING_CONTROL @@ -59,8 +51,8 @@ shopt -s extglob #include .files when globbing. shopt -s dotglob #but ignore files name . and .. -#those are default when this is set to anything, so we just set it to one of them -export GLOBIGNORE=. +# this also sets dotglob, but no harm in setting it explicitly +export GLOBIGNORE=*/.:*/.. # broken with bash_completion package. Saw a bug for this once. Don't anymore. # still broken in wheezy @@ -150,8 +142,7 @@ HISTIGNORE="k *" export BC_LINE_LENGTH=0 -path_add --ifexists /a/opt/adt-bundle*/tools /a/opt/adt-bundle*/platform-tools -path_add $HOME/bin/bash-programs-by-ian/utils + # note, if I use a machine I don't want files readable by all users, set # umask 077 # If fewer than 4 digits are entered, leading zeros are assumed @@ -160,6 +151,20 @@ C_DEFAULT_DIR=/a +################### +## include files ### +################### + +for x in $HOME/bin/bash-programs-by-ian/repos/*/*-function; do + source "$x" +done +source $HOME/bin/identify-distro-functions +source $HOME/bin/semi-private # so I can share my bashrc +source $HOME/path_add-function +path_add --ifexists /a/opt/adt-bundle*/tools /a/opt/adt-bundle*/platform-tools +path_add $HOME/bin/bash-programs-by-ian/utils + + ############### ### aliases ### ############### @@ -216,6 +221,9 @@ if [[ $OS == Windows_NT ]]; then fi + + + ##################### ### functions #### ##################### @@ -276,7 +284,7 @@ bashrcpush () { tar cz bin/bash-programs-by-ian bin/semi-private .profile | ssh $x tar xz done cd $(mktemp -d) - cp ~/path_add-function ~/.bashrc ~/.bash_profile ~/.profile ~/.bashrc_profile . + cp ~/path_add-function ~/.bashrc ~/.bash_profile ~/.profile ~/.bash_profile ~/.inputrc . for x in "$@"; do tar cz path_add-function .bashrc | ssh $x tar xz done @@ -318,15 +326,6 @@ dc() { } -distro_name() { - if [[ -f /etc/fedora-release ]]; then - echo fedora - else - grep "^ID=.*" /etc/os-release | sed 's/^ID=//' - fi -} - - dt() { date "+%A, %B %d, %r" "$@" } @@ -477,6 +476,8 @@ despace() { } + + # package manager # aliases would be much more compact, but they can't be used as ssh commands # also, to be used in a script, you need -i which prints annoying @@ -762,6 +763,8 @@ else fi + + # todo, update this complete -F _longopt la lower low rlt rld rl lld ts ll dircp ex fcp fct fpst gr @@ -940,6 +943,9 @@ if [[ $- == *i* ]]; then fi + + + ########################################### # stuff that makes sense to be at the end # ###########################################