Re: recursive functions in bash

2007-11-30 Thread davedoom
This code produces the error message: [EMAIL PROTECTED]:~$ function swap_until_one_left { [[ 0 == $( wc -l $1 ) ]] && echo "empty file" && exit; [[ 1 == $( wc -l $1 ) ]] && cat $1 && exit; [[ 2 == $( wc -l $1 ) ]] && cat <(tail -1 $1) <(head --lines=-1 $1) && return 0; cat <(tail -1 $1) <( swa

completion enhancement: automatically switch to file completion after redirection

2007-11-30 Thread Guillaume Rousse
completion after an input or output redirection still uses original command completion function: command foo > -> calls function defined for command Whereas it should probably automatically revert to plain file completion. -- Guillaume Rousse Moyens Informatiques - INRIA Futurs Tel: 01 69 35 69

recursive functions in bash

2007-11-30 Thread davedoom
hi guys, I am trying to learn to write recursive functions in bash. As one of my first attempts i wrote this program to emulate the system provided tac command: after playing with it for a good bit, it no longer produces this error message: malloc: ../bash/subst.c:4135: assertion botched reallo