Consider this very simple bash script:
#!/bin/bash
cat > /tmp/file
It redirects everything that you bring to the file. eg.
echo "hello" | script.sh
and "hello" will be in / tmp / file. This works ... but there seems to be a native way for bash to do this without using "cat". But I canβt understand.
NOTE:
It must be in the script. I want the script to work on the contents of the file afterwards.
It should be in the file, the steps in my case include a tool that only reads from the file.
I already have a pretty good way to do this - just that it seems like a hack. Is there a home way? Like "/ tmp / file <0" or "0> / tmp / file". I thought bash would have its own syntax to do this ...