Topic
1 reply Latest Post - ‏2013-07-28T00:43:25Z by flodstrom
XY24_Bhaskar_Chetry
XY24_Bhaskar_Chetry
1 Post
ACCEPTED ANSWER

Pinned topic AIX 6.1 OS issue Need Help

‏2013-07-08T10:02:52Z |

Dear All ,

I am facing a issue in AIX 6.1 .

Script:

bash-3.2$ cat a.sh
cnt_1=`ps -aef|grep "a.sh"|grep -v grep|wc -l`
ps -aef|grep "a.sh"|grep -v grep|wc -l
ps -aef|grep "a.sh"|grep -v grep
echo Count=$cnt_1
 

Output1:

bash-3.2$ oslevel
6.1.0.0

bash-3.2$ sh a.sh
       1
 preuser 34275498 15925394   0 15:29:51  pts/0  0:00 sh a.sh
Count= 2
 

Output2:

bash-2.04$ oslevel
5.3.0.0

bash-2.04$ sh a.sh
       1
ys049539 4616430 3903646   2 15:54:33  pts/1  0:00 sh a.sh
Count= 1


The second output is expected but in AIX 6.1 i am getting script running count as 2 but it should be one in background.

Kindly help me in this issue.

 

Thanks and regards

Bhaskar

  • flodstrom
    flodstrom
    57 Posts
    ACCEPTED ANSWER

    Re: AIX 6.1 OS issue Need Help

    ‏2013-07-28T00:43:25Z  in response to XY24_Bhaskar_Chetry

    You didn't mention what TL/SP you are on (oslevel -s).

    Anyway, I suspect it's your bash shell causing the problem. It works fine with the normal ksh, but have problems with bash. Check to see if your /usr/bin/sh on AIX6.1 has been replaced by that bash shell.