Bash Processes


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Bash Processes
# 1  
Old 09-30-2013
Bash Processes

Basically, can you create a new ssh session to a server (where there already say a putty session running) and operate using the same bash process?

Currently If I start a new connection then it starts a new bash process. So can this be done? Is there any benefit other than less processes? Or am I making a massive error here trying to do this. (couldn't find anything on google about this)
# 2  
Old 09-30-2013
You may want to consider the screen package that allows to leave and reenter sessions. Please be aware that screen is not unanimously welcomed by the web community.
# 3  
Old 09-30-2013
Thanks for the reply. This is the one thing I had found but did not want to use as I cannot install other programs and the screen command is deinfately not installed on the server I am using. (sorry should have said earlier)

If there is another way round or if anyone has any helpful info I am interested to hear.
# 4  
Old 09-30-2013
I do not see an issue.

1. you are using putty from a windows desktop
2. open two separate putty windows, connect to where you want
3. use Alt/Tab to switch processes. or:
4. Reshape the windows using the cursor so that both sessions fit on the screen at one time.

You can change the title of the putty windows so you don't get confused:
Code:
export SERVER=$(hostname)
echo "setting putty title to $SERVER"
export EXTRA=":Stuff I need to see goes here"
PROMPT_COMMAND="\033]0;${SERVER}${EXTRA}\007"
echo $PROMPT_COMMAND

What am I missing?
# 5  
Old 09-30-2013
Connecting to process on other server

Not sure if this is part of the question, but I did have a similar question. If you plan to log off of a session (where running processes in the background after a logoff doesn't work), can you go to another terminal and then pick up on the process that is running and continue it at the other terminal?

For example, if you have a cp (copy process) running can you keep logged in to the server you are running it on (serverA), and then attach to it from a different server (serverB) and keep it going? So I would have the cp running on serverA, attach to it on ServerB and then then log off of serverA and the process would still run?

Would a truss command allow you to hook up or help to do this? I know you can use screen and vm terminals, this is just curiosity.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

(bash) Script Processes in Parallel

Hello all, I tried to parralise my treatments but after a while 'ps -ef' display all child process <defunct> (zombie) Parent bash script to process all files (>100000) in directory: for filename in /Data/*.txt; do ./child_pprocess.sh $filename & done exit(0)I understand that the... (1 Reply)
Discussion started by: namnetes
1 Replies

2. Shell Programming and Scripting

How to run several bash commands put in bash command line?

How to run several bash commands put in bash command line without needing and requiring a script file. Because I'm actually a windows guy and new here so for illustration is sort of : $ bash "echo ${PATH} & echo have a nice day!" will do output, for example:... (4 Replies)
Discussion started by: abdulbadii
4 Replies

3. Shell Programming and Scripting

script for multi-threaded bash processes

hey everyone, I'm having some trouble breaking down some code. It's simple a control script that takes machines meant to be backed up from a list. Then according to that will run multi-threaded processes up until the specified thread limit. for example if there are 4 machines to be backed up,... (2 Replies)
Discussion started by: terrell
2 Replies

4. Shell Programming and Scripting

BASH - Handling background processes - distributed processing

NOTE: I am using BASH and Solaris 10 for this. Currently in the process of building a script that has a main "watcher" daemon that reads a configuration file and starts background processes based on it's global configuration. It is basically an infinite loop of configuration reading. Some of the... (4 Replies)
Discussion started by: dcarrion87
4 Replies

5. AIX

Typing "bash" at the command line spawns two bash processes

Server: IBM p770 OS: AIX 6.1 TL5 SP1 When one of our develoeprs types "bash" on the command line to switch shells, it hangs. For some reason, two bash processes are created....the first bash process spawns a second bash process in the same console, causing a hang. Anyone have any idea what... (2 Replies)
Discussion started by: wjssj
2 Replies

6. UNIX for Dummies Questions & Answers

Bash: Regulating the number of processes a script can spawn

I've been working on some scripts in which I spawn some background processes. I'd like to be able to limit the number of processes, but have my script spawn additional processes as previous tasks finish. So, let's say I have 20 tasks to complete. Any given task could take from 1 to 10 minutes. ... (7 Replies)
Discussion started by: treesloth
7 Replies

7. Shell Programming and Scripting

Finding the age of a unix process, killing old processes, killing zombie processes

I had issues with processes locking up. This script checks for processes and kills them if they are older than a certain time. Its uses some functions you'll need to define or remove, like slog() which I use for logging, and is_running() which checks if this script is already running so you can... (0 Replies)
Discussion started by: sukerman
0 Replies

8. UNIX for Dummies Questions & Answers

Kill child processes, when parent is "bash"

Consider this simple command line bash -c 'echo $$ ; sleep 10000'This will print the newly created bash PID and sleep for a long time. If I go to another terminal and do something like ps -flax | grep leepI'll see something like 501 92418 91910 0 0:00.00 ttys000 0:00.00 bash -c echo $$... (5 Replies)
Discussion started by: teras
5 Replies

9. Solaris

Identifying and grouping OS processes and APP processes

Hi Is there an easy way to identify and group currently running processes into OS processes and APP processes. Not all applications are installed as packages. Any free tools or scripts to do this? Many thanks. (2 Replies)
Discussion started by: wilsonee
2 Replies

10. UNIX for Advanced & Expert Users

Monitoring Processes - Killing hung processes

Is there a way to monitor certain processes and if they hang too long to kill them, but certain scripts which are expected to take a long time to let them go? Thank you Richard (4 Replies)
Discussion started by: ukndoit
4 Replies
Login or Register to Ask a Question