I am writing a bash script that will get the user defined filenames and then use alsa to play that file:
#!/bin/bash
export PATH=$PATH:/home/pi/Documents/audio
read -p "Enter a filename: " filename
aplay $filename
Above is what I have tried after reading about how to include path in a script. But at the terminal prompt, after I do ./script.sh, it returns no such a file in the directory. I also tried source ./script.sh thinking that the environment is only changed in the subshell and it returns the same.
All I need is to include the path within this script and does not change the system path permanently.
I'd appreciate it if someone can point me to the right direction. Thank you!