Currently, I have a bash script that will untar a file in my root directory:
#!/bin/bash tar xvf ~/some-file.tar
This works without problems. N
Tilde expansion doesn't work when inside a variable. You can use the $HOME variable instead:
$HOME
#!/bin/bash p=$HOME tar xvf "$p/some_file.tar"