You have an alias which is overriding the builtin source (fix with unalias source) You have a function which is overriding source (fix with unset -f source) You are somehow not using bash (although your bang line would suggest you are). source is not POSIX. Using source on dash does not work, only . works.
A dangerous one-liner that doesn't require source: export $(xargs <file) It can't handle comments, frequently used in environment files It can't handle values with whitespace, like in the question example It may unintentionally expand glob patterns into files if they match by any chance It's a bit dangerous because it passes the lines through bash expansion, but it has been useful to me when I ...
What is the difference between sourcing ('.' or 'source') and executing a file in bash? Ask Question Asked 13 years, 4 months ago Modified 4 years, 9 months ago
source is a shell keyword that is supposed to be used like this: source file where file contains valid shell commands. These shell commands will be executed in the current shell as if typed from the command line.
In my ~/.bashrc file reside two definitions: commandA, which is an alias to a longer path commandB, which is an alias to a Bash script I want to process the same file with these two commands, so I ...
2 source is there for readability and self-documentation, . exists because it is quick to type. The commands are identical. Perl has long and short versions of many of its control variables for the same reason.
The source command will: Read and execute commands from the filename argument in the current shell context. If filename does not contain a slash, the PATH variable is used to find filename. This behaviour is defined (for ., its alias) by POSIX. Why? Well, you can put sourceable configuration scripts inside PATH and access them without a qualified path. To access the file you want, give an ...
It’s a scope problem. As designed, the _source_script function is, effectively, calling itself recursively, inasmuch as it is doing . ./${!arg}.sh and sourcing files that call _source_script. But variables in shell scripts are global by default. And so multiple incarnations of the _source_script function that are active (on the stack) simultaneously, are sharing the same copy of arg. In ...
Is it possible to compare two directories with rsync and only print the differences? There's a dry-run option, but when I increase verbosity to a certain level, every file compared is shown. ls -a...
I.e., unpack the source package from your distribution, replace the source with the upstream version, check if any of the distribution's patches or configuration tweaks still apply, build the binary package (make sure you changed the version of the packaged stuff!) and install that one. Yes, it is more work than just building and installing.