LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 04-20-2009, 07:51 PM   #1
timingalls
LQ Newbie
 
Registered: Nov 2006
Distribution: Debian Unstable
Posts: 2

Rep: Reputation: 0
How can you view the progress of a process started in a non-interactive shell?


I am wondering if there is a way to view the progress or standard output of a process running in a non-interactive shell. For example, I am running Ubuntu, and from the shell I issued the following commands from my Palm Treo on my bus ride home:

Code:
# at 6:12 PM
>apt-get dist-upgrade --yes
>(CTRL-D)
#
Later, I wanted to find out where in the process the upgrade was, if it was stuck, if it was waiting for some type of input, etc. Running
Code:
ps -A u
showed me that the process was still running. I wondered if something had gone wrong or if it was stalled for some reason, but I didn't know how to view any of the output of the process. I guess next time I should redirect standard output to a file (if I can figure that out), but I'm still wondering if there is a way to view the output of the process while it is running.

Does anyone know how to jump into the middle of a process like this and redirect its standard output?
 
Old 04-21-2009, 02:29 PM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,943
Blog Entries: 5

Rep: Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753
Not really possible after you started it.

However, before you start it next time you can use the "screen" command to open a session that is detachable and attachable. This allows you to start a process on one device then later view it on another (or at same time).

Type "man screen" for more details.

As to what is running now:
You might want to run "lsof -p <PID>" on the process currently running to see what files it has open. Perhaps there's a log somewhere that you can view to see what is going on. Failing that having a look in /var/log may give you some hints.
 
  


Reply

Tags
noninteractive, output, processes, shell, standard


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
View Progress or Timer of processes !! arunabh_biswas Programming 2 10-04-2008 03:58 PM
progress view command for linux mpmackenna Linux - General 6 06-17-2008 09:44 AM
how to know if the shell is interactive or not? anupamsr Linux - Newbie 2 01-20-2007 07:31 AM
interactive and non-interactive shell linuxjamil Programming 3 09-03-2006 08:42 PM
bash script works when interactive, endless loop when started via cron dguy Linux - General 5 04-10-2006 11:39 AM


All times are GMT -5. The time now is 08:11 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration