-
Junior Member
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.
-
Junior Member
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
-
Forum Rules