At the command prompt, I get the following:
$ FOO=foo $ echo $FOO foo $ echo $$FOO 11971FOO
Here $$ resolves the shell PID, as expected, and "FOO" is printed verbatim.
Now, trying to understand and debug some scenarios, I found the following:
#!/bin/bash FILE1=/path/to/file/1 FILE2=/path/to/file/2 echo $$FILE1 >> $$FILE2
The script arises from the postinstall script of the Debian package. Is he supposed to have to undergo pre-processing before he can work?
Update: the script is part of a package created using epm and read using the following directive:
%postinstall <script.sh
In the resulting package, the deb postinst script reads:
#!/bin/bash FILE1=/path/to/file/1 FILE2=/path/to/file/2 echo $FILE1 >> $FILE2
Thus, the processing is performed either using epm or dpkg.
source share