1809 |
|
|
1810 |
@defun substitute-in-file-name filename |
@defun substitute-in-file-name filename |
1811 |
This function replaces environment variables references in |
This function replaces environment variables references in |
1812 |
@var{filename} with the environment variable values. Following standard |
@var{filename} with the environment variable values. Following |
1813 |
Unix shell syntax, @samp{$} is the prefix to substitute an environment |
standard Unix shell syntax, @samp{$} is the prefix to substitute an |
1814 |
variable value. |
environment variable value. If the input contains @samp{$$}, that is |
1815 |
|
converted to @samp{$}; this gives the user a way to ``quote'' a |
1816 |
|
@samp{$}. |
1817 |
|
|
1818 |
The environment variable name is the series of alphanumeric characters |
The environment variable name is the series of alphanumeric characters |
1819 |
(including underscores) that follow the @samp{$}. If the character following |
(including underscores) that follow the @samp{$}. If the character following |
1820 |
the @samp{$} is a @samp{@{}, then the variable name is everything up to the |
the @samp{$} is a @samp{@{}, then the variable name is everything up to the |
1821 |
matching @samp{@}}. |
matching @samp{@}}. |
1822 |
|
|
1823 |
|
Calling @code{substitute-in-file-name} on output produced by |
1824 |
|
@code{substitute-in-file-name} tends to give incorrect results. For |
1825 |
|
instance, use of @samp{$$} to quote a single @samp{$} won't work |
1826 |
|
properly, and @samp{$} in an environment variable's value could lead |
1827 |
|
to repeated substitution. Therefore, programs that call this function |
1828 |
|
and put the output where it will be passed to this function need to |
1829 |
|
double all @samp{$} characters to prevent subsequent incorrect |
1830 |
|
results. |
1831 |
|
|
1832 |
@c Wordy to avoid overfull hbox. --rjc 15mar92 |
@c Wordy to avoid overfull hbox. --rjc 15mar92 |
1833 |
Here we assume that the environment variable @code{HOME}, which holds |
Here we assume that the environment variable @code{HOME}, which holds |
1834 |
the user's home directory name, has value @samp{/xcssun/users/rms}. |
the user's home directory name, has value @samp{/xcssun/users/rms}. |