Reputation:
I followed previous threads:
I want to execute shell file and write into text parallel. Content should be written first in text file and the shell file should be executed.
# input.txt < "I love cat, she is nice" && ./test.sh
bash: I love cat, she is nice: No such file or directory
Another try:
# ./test.sh && input.txt < "I love cat, she is nice"
batch processes ..
bash: I love cat, she is nice: No such file or directory
What is the correct way?
Upvotes: 0
Views: 57
Reputation: 24535
Why not following?
echo "I love cat, she is nice" > input.txt; ./test.sh
Upvotes: 0
Reputation: 207465
I think you mean this - you want a script to create a script and then run it:
echo "echo hello" > go.sh && chmod +x go.sh && ./go.sh
hello
Upvotes: 0