I have a script that i want to create files, depending on the directory the user (me) is in (it can be called from command line). However, it creates the file in the same directory the script is located. How can I change the script so it creates the file in the same directory as the terminal?
Note: The command pwd
when executed inside the script will print the working directory of the script, not the terminal.