How do I append a string to all the files in a directory that starts with a particular string?
I tried,
cat mysig >> F*
But instead of appending contents of mysig to all files starting with F, it creates a file named “F*”. Obviously wildcard doesn’t seem to work.
Any alternatives?
Thanks in advance.
Edit:
Also how do I delete this newly created file “F*” safely?. Using
rm F*
would delete all the files starting with F which I wouldn’t want.
The shell can’t do that directly, since there will only be a single stream coming from the source program (the cat, in this case).
You need a helper program, such as tee. Try this: