Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-26-2012
Registered User
 
Join Date: Mar 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Screen output is blocked by "| tee" command

BACK STORY:

I have a script build.py . (It's for creating the ISO file for a special edition of Swift Linux.) This build.py script executes the mintConstructor.py script that I use to modify the Regular Swift Linux ISO to get the special edition Swift Linux ISO. The lines of the script that do this are:

command_remaster = 'python /usr/lib/linuxmint/mintConstructor/mintConstructor.py '
os.system (command_remaster)

To create Taylor Swift Linux, I enter in a Bash shell the following command:
sudo python /home/username/develop/special/build.py 'ts' 'Taylor Swift Linux'

This allows me to see the full screen output of the mintConstructor.py script that is called by the build.py script. Unfortunately, this command doesn't log the output.

THE CONUNDRUM:

Seeing the mintConstructor.py output on the screen AND logging this output seems to be mutually exclusive. To add insult to injury, the log file is empty UNTIL the entire process is finished.

The command I'm using to try to do both is:
sudo python /home/username/develop/special/build.py 'ts' 'Taylor Swift Linux' | tee /home/username/develop/test-output/test1.txt

THE QUESTION:
How can I get the full mintConstructor.py output on the screen AND log
this output to a file?
Sponsored Links
    #2  
Old 03-26-2012
Mead Rotor
 
Join Date: Aug 2005
Location: Saskatchewan
Posts: 16,380
Thanks: 491
Thanked 2,535 Times in 2,418 Posts
You could try the 'script' utility, which captures all terminal output even while it's being displayed to the screen.
Sponsored Links
    #3  
Old 03-26-2012
Registered User
 
Join Date: Mar 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Is there a way to get the script command (and the exit at the end) to run AUTOMATICALLY?
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
awk command to replace ";" with "|" and ""|" at diferent places in line of file shis100 Shell Programming and Scripting 7 03-16-2011 08:59 AM
"Join" or "Merge" more than 2 files into single output based on common key (column) Katabatic Shell Programming and Scripting 1 05-20-2010 11:41 AM
Explanation of "total" field in "ls -l" command output proactiveaditya UNIX for Dummies Questions & Answers 1 04-18-2010 01:40 AM
To record screen output using "script" command ggayathri Shell Programming and Scripting 2 03-01-2009 02:54 PM
Q: Recording shell script screen output using "script" command ? lalfonso.gomez Shell Programming and Scripting 4 01-18-2007 08:31 PM



All times are GMT -4. The time now is 01:46 PM.