Current shell session hungs when run another binary


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Current shell session hungs when run another binary
# 1  
Old 12-28-2015
Current shell session hungs when run another binary

Hi,
I am on AIX 7.1 and when I try to login to my account and sudo to other generic account (mqm user) my ssh session just hungs.

==================
Code:
$ id
uid=16150(sxp) gid=179(rax) groups=1179(raxs)
$
$
$ sudo su - mqm
Password:

--------
Changed username to: mqm
--------
Code:
. /opt/IBM/mq8/usr/mqm/bin/setmqenv -p /opt/IBM/mq8

-- this works when executed manually.
==================

I need to include the above command (. /opt/IBM/mq8/usr/mqm/bin/setmqenv -p /opt/IBM/mq8) in .kshrc to avoid retyping every time when I log into mqm user.

When I include this command in .kshrc, my login session just hungs when I sudo to mqm user. I need to do a 'Ctrl + c' to come out.

Can you please advise how to avoid the hung session?.

Last edited by Don Cragun; 03-07-2016 at 04:15 PM.. Reason: Add CODE tags.
# 2  
Old 12-29-2015
.kshrc? If this works at all, there is the risk of recursion.
Put it to .profile (that runs once at login)!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to track what Commands run in a login session

Hi I need to track what commands run in login session in solaris whether it is root or any normal users in bash shell. My actual requirement is that when a user (nomal/root) login into the system, whatever commands he run, it should log into file on specified path . I don't require command... (4 Replies)
Discussion started by: hb00
4 Replies

2. UNIX for Advanced & Expert Users

Run only 3 sqlplus session at a time

Below code runs n number of session at a time when called. I want to restrict it to run only for 3 sqlplus at a time. Is there a way to do the same. for name in `cat abc.txt` do (sqlplus -s usert/password@host <<-EOF>> error.txt SET LINESIZE 1000 select '$name',... (4 Replies)
Discussion started by: ATWC
4 Replies

3. Red Hat

Current Session History

Dear All, I want to display the command related to current session in Redhat Linux 5. Below history command display all the command in ~/.bash_history file. $history My requirement is the command executed in my current session.I mean to say. Suppose after log in as root i executed ... (1 Reply)
Discussion started by: monojcool
1 Replies

4. Shell Programming and Scripting

How to run scripts within a telnet session?

I want to connect to a remote host using telnet there is no username/password verification just telnet remotehost then I need to input some commands for initialization and then I need to repeat the following commands: cmd argument argument is read from a local file, in this... (1 Reply)
Discussion started by: esolve
1 Replies

5. Shell Programming and Scripting

Report the current time in Binary format

Hey fellas, I am trying to report the current time in a binary format which is overwriting every second. So far I wrote following script which I know looks stupid since I'm a newbie! ;) #!/bin/bash while true; do clear; date | awk '{print $4}' | awk -F ":" '{print... (4 Replies)
Discussion started by: @man
4 Replies

6. Shell Programming and Scripting

running a bash script even after logging out from the current session

HI , I have a simple script that moves files from one folder to another folder, I have already done the open-ssh server settings and the script is working fine and is able to transfer the files from one folder to another but right now I myself execute this script by using my creditianls to... (4 Replies)
Discussion started by: nks342
4 Replies

7. UNIX for Dummies Questions & Answers

Export script to current session

Hi, I have a script called bash$> cat -ev setprofile.sh alias rm='rm -i'$ $ The alias does not take effect unless i run the script as bash$> . ./setprofile.sh What do I have to do in-order to simply run (9 Replies)
Discussion started by: shifahim
9 Replies

8. Shell Programming and Scripting

Execute commands from script in current bash session

I have a file as follows: cat /etc/mxg/ssh-hostsmx.example1.com.au:2225 mx2.example2.com.au:2225 mx.example3.com.au:2225 mail.example4.com.au:2225 mail.example5.org.au:2225 mail.example6.com.au:2225I want to dynamically create aliases for quick access to these servers from bash. I wrote... (4 Replies)
Discussion started by: jelloir
4 Replies

9. UNIX for Dummies Questions & Answers

how to run who am i from remote session

I just moved from AIX 4 to AIX 5.3. the command `who am i` is essential to our logon scripts; but it does not work anymore, it says the process is not attached to a terminal. Is it possible to run this command remotely? It works for remote root sessions. If it is not is there another way to... (2 Replies)
Discussion started by: raidzero
2 Replies

10. Shell Programming and Scripting

How to run a new shell with copy of current shell declarations?

How to run another shell and have all current shell dectaration copied to that new shell? I would like to have available all current declarations in a new shell. That are functions, aliases, variables. I need to test some functions that use the 'exit', but running it in current shell on... (9 Replies)
Discussion started by: alex_5161
9 Replies
Login or Register to Ask a Question