Group,
I have having a problem with spaces in individual elements of an array.
The space causes a single element to be seen as multiple elements.
Here is a sample run:
-
[EMAIL PROTECTED]:~/bin> ./arraywithspace.sh
3.1.17(1)-release
got 6 parm
exhaustive test because this solution will work for me.
--
potter
On Nov 10, 2007 12:27 PM, Andreas Schwab <[EMAIL PROTECTED]> wrote:
> "Michael Potter" <[EMAIL PROTECTED]> writes:
>
> > countparms ${Arguments[*]}
>
> Use "[EMAIL PROTECTED]" instead
It is not a bug in bash. it is just how it works. the while loop
creates a subshell and changes to the variables are not visable
outside of the subshell. if you put the while loop first, then it
will not create the subshell.
do this:
result=""
while read line; do
extracteddata=`echo "$
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
ot really care for this solution.
I hope someone will comment with a graceful solution.
--
Michael Potter
On Jan 31, 2008 11:43 AM, Michael Potter <[EMAIL PROTECTED]> wrote:
> Bash Bunch,
>
> Not surprisingly, bash does not exit the script when an error is detected
> in a subs
ON". Hopefully someone will point
out a more graceful solution.
--
potter
On Feb 1, 2008 1:56 PM, Linda Walsh <[EMAIL PROTECTED]> wrote:
>
>
> Michael Potter wrote:
> > Bash Bunch,
> >
> > Not surprisingly, bash does not exit the script when an error is detected in
find in my real script. I just used that here so
anyone could reproduce the problem.
--
Michael Potter