如何按数字对此输出进行排序?
echo "test/app_name_114.sh test/app_name_116.sh test/app_name_117.sh test/app_name_118.sh test/app_anothername_114.sh test/app_anothername_117.sh"
然后以相反的顺序。我期待:
test/app_anothername_114.sh test/app_name_114.sh test/app_name_116.sh test/app_anothername_117.sh test/app_name_117.sh test/app_name_118.sh
尝试sort -t _ -k5
答案 0 :(得分:0)
使用<%= User.find_by_username(params[:id]).username %>
替换换行符,然后tr
,然后将其替换回来:
sort