Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
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?...
  1. #1
    Just 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?

  2. #2
    Linux User
    Join Date
    Nov 2009
    Location
    France
    Posts
    292
    script &> /dev/null

    But that's a bad idea !

  3. #3
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    if you don't see the output, how will you know things were successful or not?

  4. #4
    Linux Guru Rubberman's Avatar
    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
    Quote Originally Posted by nmset View Post
    script &> /dev/null

    But that's a bad idea !
    Indeed! Better to pipe the output to a file. Then you can see if there were any problems. IE: script &> /tmp/script.out
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Linux 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.

  6. #6
    Linux Guru Rubberman's Avatar
    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!

  7. #7
    Just Joined!
    Join Date
    Oct 2008
    Posts
    48
    so good! /dev/null is the solution.
    thanks!

  8. #8
    Just 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.

  9. #9
    Just 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

  10. #10
    Just 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.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...