I have files in a directory:
mkdir in_dir
echo 'a' > in_dir/file1.txt
echo 'b' > in_dir/file2.txt
echo 'c' > in_dir/file3.txt
mkdir out_dir
I have a command that takes input from files using < and writes output to a new file with >. I want to run it on all files in in_dir and write the output to out_dir under a matching file name.
This does the first part, runs a (dummy) command on each file.
#!/bin/zs
for file in in_dir/*;
(cat $file ; echo '1')
I'd like to have 'file1.txt' in out_dir with the content 'a1', 'file2.txt' with 'b1' etc.
out_dir/file1.txt?aora1?