I am trying to write a script that appends a line of text to a group of files.
Currently I have a text list of directories with complete path, but no file name.
Here is my sample I am building from:
It works fine but I need to output to 130 Makefiles in different directories.
So I have a list of ports and I need to use it as part of the output pipe.
Plus need to suffix a filename(Makefile) on the end of these directories.
My ports list looks like this[snipped]:
depends.list
So what I have done is used a variable in a script to define files to use for output.
tee.sh
Problem with that is it is interpreting the list wrong. I need it to process the contents of that file.
How can I have it read the contents of this file and not try and use it literally. Is this what readline does?
Thanks for your help.
Currently I have a text list of directories with complete path, but no file name.
Here is my sample I am building from:
echo "hello" | tee -a file1 file2
It works fine but I need to output to 130 Makefiles in different directories.
So I have a list of ports and I need to use it as part of the output pipe.
Plus need to suffix a filename(Makefile) on the end of these directories.
My ports list looks like this[snipped]:
depends.list
Code:
/usr/ports/graphics/tiff
/usr/ports/graphics/jbigkit
/usr/ports/graphics/jpeg-turbo
/usr/ports/devel/nasm
/usr/ports/graphics/png
/usr/ports/graphics/jasper
So what I have done is used a variable in a script to define files to use for output.
tee.sh
Code:
#!/bin/sh
portlist=/usr/ports/graphics/xv/depends.list
echo "test" |tee -a ${portlist}/Makefile
Code:
:~ # sh tee.sh
tee: /usr/ports/graphics/xv/depends.list/Makefile: Not a directory
test
Thanks for your help.