鉴于这样的道路:
/data/mirrors/third-party/centos/5/projectA/x86_64
/data/mirrors/third-party/centos/5/projectA/i386
/data/mirrors/third-party/centos/5/projectA/noarch
/data/mirrors/third-party/centos/4/projectB/x86_64
/data/mirrors/third-party/centos/4/projectB/i386
/data/mirrors/third-party/centos/4/projectB/noarch
/data/mirrors/third-party/centos/4/projectC/x86_64
/data/mirrors/third-party/centos/4/projectC/i386
/data/mirrors/third-party/centos/4/projectC/noarch
我如何利用Bash的炮兵指挥从第5和第7场(5和x86_64) values取价值?
我有这样的一些东西,但我只想找一些更令人费解的事,而不需要抓起 ju子。
cd /data/mirrors/third-party/centos/5/project/x86_64
echo `pwd` | tr / | while read junk1 junk2 junk3 junk4 version junk5 arch; do
echo version=$version arch=$arch
done
version=5 arch=x86_64