2009/04/01

Bash Tidbit: environment variables after escaped semicolons

If you find yourself in need of embedding an environment variable in a path directly after an escaped semicolon (something that happens when you have version control tools like Telelogic, which use semicolons as a project toplevel node delimiter) it is possible to merely use backticks "`<around the command>`" to get the desired effect.

Say your default case on the command line to list the directory contents is thus:


ls /mnt/buford/d/teledb/ccm_wa/poobits01/foo.bar\;foo.bar99.99_int/foo.bar/


And you want the 'foo.bar99.99' to be something settable in a shell variable called $REL you then would insert the following to do such a thing:

REL=foo.bar99.99
ls /mnt/buford/d/teledb/ccm_wa/poobits01/foo.bar\;`echo $REL`_int/foo.bar/

No comments: