I have a simple bash file and want to execute a cd command:
#!/bin/bash
dir_path="~/Desktop/param_bind_b"
cd $dir_path
for some reason, when I try to run this script in terminal, I get this error:
student@ubuntu:~$ openptv_current_install.bash /home/student/Desktop/scripts/openptv_current_install.bash: line 3: cd: ~/Desktop/param_bind_b: No such file or directory
when I run the command cd ~/Desktop/param_bind_b
"manually" it runs as expected.
what am I missing here?
$HOME
instead of~
in scripts.