zenity progress and simultaneously terminal output


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting zenity progress and simultaneously terminal output
# 1  
Old 07-07-2011
zenity progress and simultaneously terminal output

Hi,

I want to use zenity --progress and also put the output to the terminal.

I tried using the tee command but that puts the output to the terminal first and then shows the zenity progress dialog.

Take the normal example by the gnome manual:
Code:
      (
        echo "10" ; sleep 1
        echo "# Updating mail logs" ; sleep 1
        echo "20" ; sleep 1
        echo "# Resetting cron jobs" ; sleep 1
        echo "50" ; sleep 1
        echo "This line will just be ignored" ; sleep 1
        echo "75" ; sleep 1
        echo "# Rebooting system" ; sleep 1
        echo "100" ; sleep 1
        ) | tee zenity --progress \
          --title="Update System Logs" \
          --text="Scanning mail logs..." \
          --percentage=0

Is there any method to do both simultaneously?

---------- Post updated 07-07-11 at 01:25 AM ---------- Previous update was 07-06-11 at 04:07 AM ----------

Looks like nobody has got any solution??

The original code is this:
Code:
#!/bin/sh
       (
        echo "10" ; sleep 1
        echo "# Updating mail logs" ; sleep 1
        echo "20" ; sleep 1
        echo "# Resetting cron jobs" ; sleep 1
        echo "50" ; sleep 1
        echo "This line will just be ignored" ; sleep 1
        echo "75" ; sleep 1
        echo "# Rebooting system" ; sleep 1
        echo "100" ; sleep 1
        ) | zenity --progress \
          --title="Update System Logs" \
          --text="Scanning mail logs..." \
          --percentage=0

I want the output to be printed on the terminal also. Any solutions??
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[zenity] precise progress bar

Hello everyone, Is it possible to have a precise progress bar in zenity during the execution of the following: find -type f \( -not -name "$file_name".md5 \) -exec md5sum '{}' \; > "$file_name".md5Currently I am using zenity --title="Running..." --progress --pulsate --auto-close... (1 Reply)
Discussion started by: soichiro
1 Replies

2. Shell Programming and Scripting

Function to run a progress bar in zenity

First off, I'm a novice in bash... I'm trying to make a progress bar in zenity to show progress of a file download. When complete, the progress bar should exit. I'm using a function for the progress bar. Any help appropriated. My code is : #!/bin/bash progress_bar() { ( while : do #... (3 Replies)
Discussion started by: allen11
3 Replies

3. Shell Programming and Scripting

Print Terminal Output Exactly how it Appears in the Terminal to a New Text File

Hello All, I have a text file containing output from a command that contains lots of escape/control characters that when viewed using vi or view, looks like jibberish. But when viewed using the cat command the output is formatted properly. Is there any way to take the output from the cat... (7 Replies)
Discussion started by: mrm5102
7 Replies

4. Shell Programming and Scripting

Looping with zenity's progress bar

Hi, me again :} I do have a little issue with my pseudo code. I am trying to copy files from one place to another and show the progress bar of the task, however the progress will start on 0% and change its GUI to 100% immediately (there is no progress on the bar), files were copied to desired... (1 Reply)
Discussion started by: defila
1 Replies

5. Shell Programming and Scripting

Redirect an output from a script to a file and display it at a console simultaneously

Hi, I'd like to redirect the STDOUT output from my script to a file and simultaneously display it at a console. I've tried this command: myscript.sh | tail -f However, it doesn't end after the script finishes running I've also tried this: myscript.sh | tee ~/results.txt But it writes... (3 Replies)
Discussion started by: wenclu
3 Replies

6. UNIX for Advanced & Expert Users

Command to output ones (like zero-fill), with progress indicator

Well, I was originally going to post this snippet in the original thread titled "how to output ones endlessly like /dev/zero", but that topic was closed without an efficient answer. It was difficult to find (build) a satisfactory answer to this one, so I thought I'd share it here and as a "fill... (1 Reply)
Discussion started by: Gliktch
1 Replies

7. Shell Programming and Scripting

command output to variable assignment and screen simultaneously

Hello Folks, I have a script that runs a command (rsync) that sometimes takes a long time to complete and produces diagnostic output on stdout as it runs. I am currently capturing this output in a variable and using it further in the script. I would like to continue to capture this output... (2 Replies)
Discussion started by: mbm
2 Replies

8. UNIX for Dummies Questions & Answers

Command display output on console and simultaneously save the command and its output

Hi folks, Please advise which command/command line shall I run; 1) to display the command and its output on console 2) simultaneous to save the command and its output on a file I tried tee command as follows; $ ps aux | grep mysql | tee /path/to/output.txt It displayed the... (7 Replies)
Discussion started by: satimis
7 Replies

9. UNIX for Advanced & Expert Users

Terminal Output to a File ??

Hey, How can I transfer the terminal output to a file ? For example : command "fuser" returns the "process-id" and prints the output on the terminal, but I want that output to a file as well. How can I do that ? /clocal/mqbrkrs/user/mqsiadm/sanjay/AccessMonitor $ fuser -uf... (2 Replies)
Discussion started by: varungupta
2 Replies

10. Programming

output to terminal

How can I write to another user's pseudo tty, but not to its current prompt position (as in open("/dev/pts007", ...) followed by write() ). Instead I would like to write to the top center of the screen using color red, for example. Like curses, but from another console. (6 Replies)
Discussion started by: andreis
6 Replies
Login or Register to Ask a Question