I wrote a very simple program to test outputting data to a file name variable.
#!/bin/sh
file="~/output"
echo "test" > $file
When I run this script, I got the following error
"./script.sh: line 3: ~/output: No such file or directory"
So how should I revise my code to get it work? Or it's not supported in shell script?