First let me say THANKS for your help. i'm at the head to the wall stage
Ok, in order as they came
will not work -o not recognized so yes i should have separated from bash issues
Code:
colons=${testline//[!:]/} does not work - bad substitution error
count=${#colons}
Code:
mycounter=$(( mycounter + 1 ))
errors with - 'mycounter=$' not expected
Code:
: $(( mycounter += 1 ))
errors with - syntax error a line 6: '(' unexpected
errors seq not found
Code:
i=0
while [ $(( i += 1 )) -le 8 ]
errors with (you guessed it) '(' unexpected
nothing with double (()) is accepted.
Code:
grep "^[[:alpha:]]"
Sorry, this does actually work
Code:
NevVal=$(($myval/$myDivisor))
Quote:
That works as far back as bash-1.14
Are you sure the script is being executed with bash?
|
To test i write a minimal script with just the questionable command in it. This is what i used to test
Code:
NevVal=$(($myval/$myDivisor))
Code:
#!/usr/bin/bash ## also run /bin/bash
myval=10
myDivisor=5
NevVal=$(($myval/$myDivisor))
My response it
Code:
test7.sh: syntax error at line 6: 'NewVal=$' unexpected
And no, i'm not sure anything is running in bash at any time
To try and check i added a
to a couple of the mini-scripts and it reports back /bin/bash whether i have /bin/bash or /usr/bin/bash. the two files are the same (not links)
AND A NEW ONE
case isn't working as expected, my mini test is as follows
Code:
#!/usr/bin/bash
echo $SHELL
while read myDomain
do
myCounter=`cat domain_file.txt |awk '{print $3}'|grep "^$myDomain"|wc -l`
echo $myCounter
case $myCounter in
0) echo "found a 0";;
1) echo "found a 1";;
2) echo "found a 2";;
*) echo "everything else";;
esac
done < domains_only.txt
i get as a response the count then everything falls through the catchall.
Code:
/bin/bash
7
everything else
3
everything else
4
everything else
1
everything else
....