From 2dea7f4f436546bb422f59911f406d500985d01f Mon Sep 17 00:00:00 2001 From: lace <> Date: Sun, 9 Mar 2008 18:45:41 +0000 Subject: [PATCH] No longer export all our custom functions. - `ls' broke the `configure' `ls -t' check. --- .bashrc | 100 ++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/.bashrc b/.bashrc index aabd5d8..842e954 100644 --- a/.bashrc +++ b/.bashrc @@ -20,7 +20,7 @@ if [ -n "$PS1" -a -z "$_home_short_dotbashrc" ];then export _home_short_dotbashrc=true # $TERM gets restored to its 'norc-' state after ~/.bashrc # alias norc='TERM="norc-$TERM" ssh -t -o 'NoHostAuthenticationForLocalhost yes' $USER@localhost "cd $PWD; TERM=$TERM;"' - function norc { TERM="norc-$TERM" ssh -t -o 'NoHostAuthenticationForLocalhost yes' $USER@localhost "cd $PWD; TERM=$TERM;" "$@"; }; export -f norc + function norc { TERM="norc-$TERM" ssh -t -o 'NoHostAuthenticationForLocalhost yes' $USER@localhost "cd $PWD; TERM=$TERM;" "$@"; } # Fix $USER and $LOGNAME (not $MAIL) for /etc/passwd line: # root-lace:x:0:0:root for Jan Kratochvil:/home/root-lace:/bin/bash @@ -123,35 +123,35 @@ unalias 2>/dev/null ll # ls -l --color=auto # Aliases would get processed during the parsing of this script file! eval ' - function grep {(unset grep; ( ulimitme; grep "$@"; ); );}; export -f grep + function grep {(unset grep; ( ulimitme; grep "$@"; ); );} - function ls {(unset ls; ( ls -bF "$@"; ); );}; export -f ls - function l { ls -lbF "$@"; }; export -f l + function ls {(unset ls; ( ls -bF "$@"; ); );} + function l { ls -lbF "$@"; } if which vim &>/dev/null;then alias vi="vim" else echo >&2 "WARNING: No vim(1)." fi - function grepb { grep --binary-files=binary "$@"; }; export -f grepb - function L { lynx "$@"; }; export -f L - function chown {(unset chown; ( chown --no-dereference "$@"; ); );}; export -f chown - function chgrp {(unset chgrp; ( chgrp --no-dereference "$@"; ); );}; export -f chgrp - function hexedit {(unset hexedit; ( hexedit -s "$@"; ); );}; export -f hexedit - function cvs2cl {(unset cvs2cl; ( cvs2cl --window 3600 --separate-header --no-wrap "$@"; ); );}; export -f cvs2cl - function cvsfiles { cvsutil --files --print "$@"; }; export -f cvsfiles - function cvsignores { cvsutil --ignores --print "$@"; }; export -f cvsignores - function cvsignoresall { cvsutil --ignores --workings --print "$@"; }; export -f cvsignoresall - function cvsignoresrm { cvsutil --ignores --rm "$@"; }; export -f cvsignoresrm - function cvsignoresrmall { cvsutil --ignores --workings --rm "$@"; }; export -f cvsignoresrmall - function cvsignoresallrm { cvsutil --ignores --workings --rm "$@"; }; export -f cvsignoresallrm - function svnignoresall { svn status |sed -n "s/^[?] //p" "$@"; }; export -f svnignoresall - function svnignoresallrm { svn status |sed -n "s/^[?] //p"|tr "\n" "\0"|xargs -0 rm -rf "$@"; }; export -f svnignoresallrm - function disass { objdump -D --target=binary --architecture=i386 "$@"; }; export -f disass - function cal {(unset cal; ( cal -m "$@"; ); );}; export -f cal - function vncreadonly { vncviewer -FullColor -Shared -ViewOnly "$@"; }; export -f vncreadonly - function diff {(unset diff; ( diff -up "$@"; ); );}; export -f diff - function rpmbuildlocal { nice rpmbuild --define "_topdir $PWD" --define "_builddir $PWD" --define "_rpmdir $PWD" --define "_sourcedir $PWD" --define "_specdir $PWD" --define "_srcrpmdir $PWD" --define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" "$@"; }; export -f rpmbuildlocal - function gdbn { gdb -nx --command=~/.gdbinit "$@"; }; export -f gdbn + function grepb { grep --binary-files=binary "$@"; } + function L { lynx "$@"; } + function chown {(unset chown; ( chown --no-dereference "$@"; ); );} + function chgrp {(unset chgrp; ( chgrp --no-dereference "$@"; ); );} + function hexedit {(unset hexedit; ( hexedit -s "$@"; ); );} + function cvs2cl {(unset cvs2cl; ( cvs2cl --window 3600 --separate-header --no-wrap "$@"; ); );} + function cvsfiles { cvsutil --files --print "$@"; } + function cvsignores { cvsutil --ignores --print "$@"; } + function cvsignoresall { cvsutil --ignores --workings --print "$@"; } + function cvsignoresrm { cvsutil --ignores --rm "$@"; } + function cvsignoresrmall { cvsutil --ignores --workings --rm "$@"; } + function cvsignoresallrm { cvsutil --ignores --workings --rm "$@"; } + function svnignoresall { svn status |sed -n "s/^[?] //p" "$@"; } + function svnignoresallrm { svn status |sed -n "s/^[?] //p"|tr "\n" "\0"|xargs -0 rm -rf "$@"; } + function disass { objdump -D --target=binary --architecture=i386 "$@"; } + function cal {(unset cal; ( cal -m "$@"; ); );} + function vncreadonly { vncviewer -FullColor -Shared -ViewOnly "$@"; } + function diff {(unset diff; ( diff -up "$@"; ); );} + function rpmbuildlocal { nice rpmbuild --define "_topdir $PWD" --define "_builddir $PWD" --define "_rpmdir $PWD" --define "_sourcedir $PWD" --define "_specdir $PWD" --define "_srcrpmdir $PWD" --define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" "$@"; } + function gdbn { gdb -nx --command=~/.gdbinit "$@"; } ' export IGNOREEOF=10 @@ -208,7 +208,7 @@ export LC_COLLATE=C # export LC_ALL=C # as it breaks Mutt "utf-8" and somehow it is no longer needed. -function wclines { awk '{x[$0]++}END{for (i in x) print x[i]"\t"i}'; }; export -f wclines +function wclines { awk '{x[$0]++}END{for (i in x) print x[i]"\t"i}'; } # SunOS does not support "-m" export ULIMITME_OPTS="" for i in "-m 100000" "-d 150000" "-v 200000";do @@ -216,24 +216,24 @@ for i in "-m 100000" "-d 150000" "-v 200000";do done # Prevent: ulimit: -m 100000 -d 150000 -v 200000: invalid number # by forcing our known $IFS value; eval(1) is needed to take $IFS to effect: -function ulimitme { IFS=" " eval "ulimit $ULIMITME_OPTS"; }; export -f ulimitme -function grep {(unset grep; ( ulimitme; grep "$@"; ); );}; export -f grep +function ulimitme { IFS=" " eval "ulimit $ULIMITME_OPTS"; } +function grep {(unset grep; ( ulimitme; grep "$@"; ); );} function finame { find . -false ` - awk ;'; }; export -f revlines + fi; );} +function ctagsh { ctags "--c-types=+px"; } +function cpan {(unset cpan; if [ $# = 0 ];then cpan;else perl -MCPAN -e "install qw($*);";fi; );} +function exx { cd "`unset exx;exx "$@"|tee /proc/self/fd/2|tail -n1|sed -n 's/^extdir=//p'`"; } +function revlines { perl -e 'print reverse <>;'; } function debuginfo { if test -n "$*";then echo "$*";else cat;fi \ |xargs rpm -qf|xargs rpmquery --qf '%{SOURCERPM}\n'|sed 's/-[^-]*-[^-]*[.]src[.]rpm$/-debuginfo/'|sort -u; } function ipcsrmall { ipcs|awk '/- Shared Memory/{x="-m"}/- Semaphore/{x="-s"}/^0x/{print "ipcrm "x" "$2}'; } -function eog {(unset eog; touch /tmp/eog.$$;eog "$@" {,,,,,,,,,}/tmp/eog.$$;rm -f /tmp/eog.$$; );}; export -f eog -function diffc { diff -u "$@"|grep -v '^\(Only in \|Binary files\)'; }; export -f diffc -function diffi { diffc -X ~/.diffi.list "$@"; }; export -f diffi -function cvs {(unset cvs; +function eog {(unset eog; touch /tmp/eog.$$;eog "$@" {,,,,,,,,,}/tmp/eog.$$;rm -f /tmp/eog.$$; );} +function diffc { diff -u "$@"|grep -v '^\(Only in \|Binary files\)'; } +function diffi { diffc -X ~/.diffi.list "$@"; } +function cvs {(unset cvs local _opts _opts_d _now _line _o _opts_d="-d" if grep -iw '\(sources.redhat.com\|sourceware.org\):/cvs/src' CVS/Root &>/dev/null;then _opts_d="";fi @@ -275,8 +275,8 @@ function cvs {(unset cvs; break done cvs $_line $_opts "$@" - ); }; export -f cvs -function perlrpm { repoquery -q --whatprovides $(for i in "$@";do echo "perl($i)";done|sed -e 's/\//::/g' -e 's/[.]pm//g'); }; export -f perlrpm + ); } +function perlrpm { repoquery -q --whatprovides $(for i in "$@";do echo "perl($i)";done|sed -e 's/\//::/g' -e 's/[.]pm//g'); } ulimit -S -c 0 set +H @@ -295,12 +295,12 @@ for key in $HOME/.ssh/id_dsa;do agenteval=/tmp/.$USER.ssh-agent.eval if lockfile -1 -r 3 -l 10 -s 1 $agenteval.lock;then test -f $agenteval -a -O $agenteval -a -G $agenteval && - # ">/dev/null" to prevent: echo Agent pid 31074; + # ">/dev/null" to prevent: echo Agent pid 31074 source $agenteval >/dev/null if [ "ssh-agent" != "`(xargs -0 /dev/null `" ];then rm -f $agenteval (test ! -e $agenteval && ssh-agent -s >$agenteval) || echo >&2 'Failing ssh-agent!' - # ">/dev/null" to prevent: echo Agent pid 31074; + # ">/dev/null" to prevent: echo Agent pid 31074 source $agenteval >/dev/null fi rm -f $agenteval.lock -- 1.8.3.1