SOLUTION: errexit does not exit script in subshells

2008-01-31 Thread Michael Potter
Bash Bunch, Here is how I 'solved' the problem: function traperr { echo "ERROR: ${BASH_SOURCE[0]} ${LINENO}" # if BASH_SUBSHELL is 0, then script will exit anyway. if (( $BASH_SUBSHELL >= 1 )) then kill $$ fi } I put solved in quotes because I do not really care for this so

Re: grep help, how do i make this shorter?

2008-01-31 Thread Bob Proulx
UniXman1234 wrote: > ./new1a < numbers.txt | grep -i -v '^a ' | grep -i -v '^the ' | grep -i -v > '^or ' | sort -f > > How would I go about merging all the greps into a scripe and putting all the > words that should be excluded into a data file Many different ways. Look at the 'grep -f' option.

errexit does not exit script in subshells

2008-01-31 Thread Michael Potter
Bash Bunch, Not surprisingly, bash does not exit the script when an error is detected in a subshell. I am hopeful that someone has a solution to this (other than: be careful to not use subshells). Here is the test run: --- ./subshellnofail.sh BEGIN ERROR: ./subshellnofail.sh 10

grep help, how do i make this shorter?

2008-01-31 Thread UniXman1234
Hi everyone, im trying to make the following command line shorter by introducing a script that join up all the grep commands ./new1a < numbers.txt | grep -i -v '^a ' | grep -i -v '^the ' | grep -i -v '^or ' | sort -f How would I go about merging all the greps into a scripe and putting all the w