From: Nicolas Boisselier Date: Fri, 10 Jul 2015 08:37:31 +0000 (+0100) Subject: timeout not as alias but fct X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=d684c82592d0497414b5ddfc2bae44f248e18ade;p=nb.git timeout not as alias but fct --- diff --git a/etc/aliases b/etc/aliases index dbede2dc..19501492 100644 --- a/etc/aliases +++ b/etc/aliases @@ -17,8 +17,6 @@ alias nmap-ping="nmap -sP -PE -PS443 -PA21,22,23,80,3389" alias arp-list="arp -an" alias pdf2jpegs='gs -dNOPAUSE -sDEVICE=jpeg -dFirstPage=1 -dLastPage=5 -sOutputFile=pdf2jpegs%d.jpg -dJPEGQ=100 -r500 -c quit' alias nb-maildir-make="maildirmake -S Maildir; for d in Spam Trash Sent;do maildirmake -f $d Maildir; done" -which timeout 1>/dev/null || alias timeout="perl -e 'alarm(shift @ARGV); exec @ARGV' --" - #[ "$UID" = "0" ] && grep -q '^_\?postgres:' /etc/passwd && alias psql='sudo -u postgres psql' diff --git a/etc/bashrc.function b/etc/bashrc.function index ae4b4967..02b49860 100644 --- a/etc/bashrc.function +++ b/etc/bashrc.function @@ -3,6 +3,12 @@ # FUNCTIONS - SH # ################################################################################# +if ! which timeout 1>/dev/null; then +timeout() { + perl -e 'alarm(shift @ARGV); exec @ARGV' -- $@ +} +fi + shell_help() { # # Print help message and return true if args contains -?-h(elp)?