shanenin Posted September 16, 2005 Report Share Posted September 16, 2005 (edited) I notice the whereis command does not use your $PATH variable. In particular it did not find the location of kate. So I decided to try and write an alisas that uses your $PATH variable. this code worksshane@mainbox ~ $ whereis -B {/usr,/usr/bin,/usr/kde/3.4/bin} -f katekate: /usr/kde/3.4/bin/kateI would think this would also work, but it does notshane@mainbox ~ $ whereis -B {`echo $PATH | tr ":" ","`} -f katekate:I would think the above code would expand to this, which does workshane@mainbox ~ $ whereis -B {/bin,/usr/bin,/usr/local/bin,/usr/qt/3/bin,/usr/kde/3.4/bin,/usr/kde/3.3/bin} -f katekate: /usr/kde/3.4/bin/kate /usr/kde/3.3/bin/kate Edited September 16, 2005 by shanenin Quote Link to post Share on other sites
shanenin Posted September 16, 2005 Author Report Share Posted September 16, 2005 (edited) I found the reason why my method using command substitution and braces does not work. normally items in braces seperated by commas expand with spaces(like I needed)shane@mainbox ~ $ echo {dfg,jjk}dfg jjkbut when I use command substitution in braces it does not behave the same way. I wonder if the maintainers of bash left out being able to use command substituion in braces for a specific reason?shane@mainbox ~ $ echo {`echo dfg,ghh`}dfg,ghhthis code workswhereis -B $(echo $PATH | tr ":" " ") -f kate Edited September 16, 2005 by shanenin Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.