Find the answer to your Linux question:
Results 1 to 5 of 5
Dear forum friends, I have a shell script which contains 5 linux commands. I want to save both commands as well as each command output into separate log file. How ...
  1. #1
    Just Joined!
    Join Date
    Apr 2009
    Posts
    59

    save command and command output

    Dear forum friends,

    I have a shell script which contains 5 linux commands. I want to save both commands as well as each command output into separate log file. How can I do this.

    Thanks & regards
    Savook

  2. #2
    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
    What are you getting at? Do you want one log file to contain the command name + arguments and the other the output of the commands? Please show current script. Thanks.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Apr 2009
    Posts
    59
    I want a single log file to contain the command name + arguments and also the output of the commands.

    Thanks & regards
    Ganesh

  4. #4
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Exclamation

    I'm not sure about getting separate log for each command ...but to log all commands and output use script command
    man script
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  5. #5
    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 Lakshmipathi View Post
    I'm not sure about getting separate log for each command ...but to log all commands and output use script command
    That should work.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

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