Results 1 to 10 of 11
I use the typical commands to install a progrma (./configure, make, make install,...) into an script.
Is it possible to don't see the output of this commands?...
- 01-08-2010 #1Just Joined!
- Join Date
- Oct 2008
- Posts
- 48
I don't want to see the result of command
I use the typical commands to install a progrma (./configure, make, make install,...) into an script.
Is it possible to don't see the output of this commands?
- 01-08-2010 #2Linux User
- Join Date
- Nov 2009
- Location
- France
- Posts
- 292
script &> /dev/null
But that's a bad idea !
- 01-08-2010 #3
if you don't see the output, how will you know things were successful or not?
- 01-08-2010 #4
- 01-08-2010 #5Linux User
- Join Date
- Nov 2009
- Location
- France
- Posts
- 292
If that's what guif wants, which was not very clear from his request, he'd better do the following :
script | tee somelogfile
This way, you can follow the output on screen at the same time it is being logged.
- 01-08-2010 #6Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
That's what I love about 'nixes - there are so many ways to "skin the cat"! It is the ultimate renunciation of the Windoze "one size fits all" philosophy.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 01-11-2010 #7Just Joined!
- Join Date
- Oct 2008
- Posts
- 48
so good! /dev/null is the solution.
thanks!
- 01-11-2010 #8Just Joined!
- Join Date
- Jan 2008
- Posts
- 17
That's not quite what people are saying...
It is recommended that you save the output for 'just in case'.
The reason for saving the output is that if there is some issue, you might be able to review the log and find the issue. If you throw the output away without looking at it, there might have been a problem and you'd never know what it was and what caused it.
When installing widget, I'd use:
( ./configure && make && make install ) 2>&1 | tee ~/widget.`date +%Y%m%d%H%M%S`.log
That way you'd see the output and it would get saved for later. As well, repeated attempts to install the software wouldn't over-write the previous log files.
If you wanted to avoid having the output display, you could still use:
( ./configure && make && make install ) 2>&1 > ~/widget.`date +%Y%m%d%H%M%S`.log
You could run the individual commands with an announcement in the file with:
logfile="widget.`date +%Y%m%d%H%M%S`.log"
( echo ; echo "----------" ; echo "Configuring widget" ; echo "----------" ; ./configure ) 2>&1 >> $logfile
or
( echo -e "\n----------\nConfiguring widget\n----------" ; ./configure ) 2>&1 >> $logfile
*note the quotes are the reverse single quote. It runs the command and puts the output in place.
- 01-11-2010 #9Just Joined!
- Join Date
- Oct 2008
- Posts
- 48
thank you Dustspeck.
/dev/null is an example.
I put this:
./configure && make && make all >> /tmp/all_output.log 2>&1
- 01-11-2010 #10Just Joined!
- Join Date
- Jan 2008
- Posts
- 17
The parentheses group the output and are important in keeping the output together.
./configure && make && make all >> /tmp/all_output.log 2>&1
is not equivalent to
( ./configure && make && make all ) >> /tmp/all_output.log 2>&1
In the first example, only the output from the make all command is stored in the log file.


Reply With Quote
