$ (dollar-sign)
As new Insider's Guide classes are no longer being offered, this site is not currently being updated. Please refer to NCBI's E-utilities documentation for more up-to-date information.
The Unix operator “$” can be used to access the value of a variable or command. This can be especially useful in conjunction with the cat
command to include the contents of a file in another Unix command.
Example
If you have a search string saved in a text file (searchstring.txt), and would like to use that search string as the value for the esearch -query
argument without having to re-type it or copy and paste, you can use the value of cat searchstring.txt
(i.e. the contents of the file “searchstring.txt”) as the -query
argument for an esearch
command.
esearch -db pubmed -query "$(cat searchstring.txt)"