Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 shell 脚本变量等“字符串”我想将此字符串作为另一个变量的值,abc 排序为字符串 = CDA 想要将 ADC 添加到“有序”变量
$string=CDA $ordered=ADC
你可以做:
> string=CDA > s=$(grep -o . <<<"$string"|sort|tr -d "\n") > echo "$s" ACD