A=abc123abc1234aa123bb123cc
echo ${A#*abc}
结果:abc123abc1234aa123bb123cc
A=abc123abc1234aa123bb123cc
echo ${A##*abc}
结果:abc123abc1234aa123bb123cc
A=abc123abc1234aa123bb123cc
echo ${A%123*}
结果:abc123abc1234aa123bb123cc
A=abc123abc1234aa123bb123cc
echo ${A%%123*}
结果:abc123abc1234aa123bb123cc
A=abc123abc1234aa123bb123cc
echo ${A/abc/ABC}
结果:ABC123abc1234aa123bb123cc
A=abc123abc1234aa123bb123cc
echo ${A//abc/ABC}
结果:ABC123ABC1234aa123bb123cc
原文地址:http://blog.51cto.com/lythjq/2073386
时间: 2024-11-10 01:00:09