Quantcast
Channel: How to enter foo-* folder without actually using wildcard or shell expansions? - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 4

Answer by G-Man for How to enter foo-* folder without actually using wildcard or shell expansions?

$
0
0

Does drush mung backticks and vertical bars?  If not, you could use

cd `ls | grep foo- | head -n 1`

If backticks don't work, but |, $, ( and ) do, then you could change the above to

cd $(ls | grep foo- | head -n 1)

If | doen't work, but $, ( and ) do, then you could do

cd $(myprog)

where myprog is a script that you write to determine the directory name.

Also -- I don't understand how you might be able to use find to help you do a cd, but, can you end your -exec with a +?


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>