Skip Navigation Bar
NLM logo

$ (dollar-sign)


Please note: following the release of the new version of PubMed, the results returned by E-utilities queries of PubMed may differ slightly from those returned in the web version of PubMed. A new PubMed API is currently under development: more information will be announced when available.

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)"

Last Reviewed: August 6, 2021