BASH Scripts No Long Work After Solaris OS Update

I have several Solaris systems at work all running SunOs 5.10, also known as Solaris 10.  My hardware team recently updated all of our Solaris-10 OS boxes, primarily to apply security updates.  We have a ton of bash shell scripts and now some scripts work on some Solaris machines, and some don't work on other Solaris machines.  Hardware team believes they applied the same updates to all of our Solaris boxes.  One of my smart team mates dug a little bit further and discovered different versions of bash running on the different machines.

How do I continue to run this problem down, i.e. during versions of bash running on various Solaris machines?  I need to have a lot of facts, details, etc. when I take this to my management team.  Our application is getting ready to go through major testing and the hope was to have multiple machines to test on.  Needless to say, we need to get this fixed ASAP, where all of our bash scripts work as they did prior to the Solaris update.

I understand there is:  $ echo $BASH_VERSION.  Need more than this.  Appreciate the help -thanks in advance.

Fast forward
LVL 1
sdrussAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

arnoldCommented:
Double check the issue is not related to a resource , nfs share, etc. that existed prior to the reboot/update o which the shell scripts depend.

top line
try running the scripts to see what the error if any.

If you have zones, etc. were these updated in accordance with the procedure?
1
sdrussAuthor Commented:
All of my bash scripts on all machines worked as expected before the Solaris Patch/Update.  After some troubleshooting looks like issue is related to (e.g "grep -c") .  When we run the scripts simply hang.  Also team noticed use of double parentheses for variable calculation and assignment hangs.
0
arnoldCommented:
something else is likely at play, updates rarely ..

double check that the update did not reset the path, running the wrong grep i.e. one from /usr/bin versus /usr/local/bn.....

pkginfo -i| egrep -i 'grep'
see i you have ...

does your setup include zones? is the issue relates to items in ....
1
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

sdrussAuthor Commented:
We have zones. Running same version of grep /usr/bin on both machines.  Difference is the version of BASH.  How can I get more information about grep command in bash 4.4.0 versus grep command in bash 3.2.57?
0
arnoldCommented:
prefix the grep with /usr/bin/grep to make sure the command is used versus a function within bash if any.

grep --version on each.

Do not think grep is a function within bash.
1
sdrussAuthor Commented:
More  information:

4 Solaris Machines have this - GNU bash, version 4.4.0(1)-release (i386-pc-solaris-2.10)
2 Solaris Machines have this - GNU bash, version 3.2.57(1)-release (i386-pc-solaris-2.10)

$ which grep
/usr/bin/grep

$ grep –V
grep: illegal option – V
Usage: grep –hblcnsviw pattern file .  .  .

$ grep -h
Usage: grep –hblcnsviw pattern file .  .  .
0
arnoldCommented:
look at /etc/release on each, potentially update the grep package on the ones that do not work.
0
sdrussAuthor Commented:
As it turns out ..... both versions of bash existing on all machines.  In some cases, a soft link pointed to the older version.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Bash

From novice to tech pro — start learning today.