سؤال

I'm very bad at regex and escaping characters. I want to use the 'cat' command in a bash script like this :

echo `cat working-dir/*OUTPUT` ;

That should print on screen, every files in the working-dir that end with "OUTPUT" but this is not working

Later in that program, i would like to do this :

cat working-dir/*OUTPUT >> result_file.txt

But is not working either :( Can you help me please?

هل كانت مفيدة؟

المحلول

Why are you using echo, or backticks, at all?

cat working-dir/*OUTPUT

Similarly,

cat working-dir/*OUTPUT >> result_file.txt

...certainly should work. Please provide a complete script for reproducing any failure that you see, including setup (creating working-dir, putting at least one file ending with OUTPUT into it, running the cat, and observing it to fail).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top