Results 1 to 2 of 2

Thread: Append the result of another shell script to the last line of a file

  1. #1
    Junior Member
    Join Date
    Nov 2005
    Answers
    1

    Append the result of another shell script to the last line of a file

    How to do this scenario? Open a file for edit mode and go to last line in the file and append the result of another shell script to this file.


  2. #2
    Junior Member
    Join Date
    Jun 2007
    Answers
    9

    Re: Append the result of another shell script to the last line of a file

    Hi, you can use >> to append to a end of a file, p.e. you have two files, file1 and file2 and you want to append file2 to the end of file 1, then you do:
    cat file2 >> file1

    that's all.
    another example, you directly put the output of a script shell,

    the scripts "script.sh":
    #!/bin/sh
    ls -l
    #end of script

    and the receptor file "receptor_file" and it's a file already existing so...

    ./script.sh >> receptor_file

    do de job...

    HTH


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact