#!/bin/bash
#
. ~/some_env database_name
The code looks just like the above, and every time I try to run it in bash I get an error that the file or directory doesn’t exist. If I make the directory it complains that I am using a directory. If I make a file, it complains that “filename is not a function”.
What does this line of code do?
It’s very hard to figure out what the line does because the search string is so short.
Also, I am very new to bash.
.is shorthand for source, so this command just executes the contents of~/some_envwith parameterdatabase_name. Note thatsourceexecutes the contents of the named file within the current shell context (i.e. not in a sub-shell) and it does not matter if the named file is not executable. If you don’t have a file namedsome_envin your home directory or a file nameddatabase_namein your current working directory then you will get an error message.