2017-11-09から1日間の記事一覧

shell scriptで¥rの改行があると文字列結合がおかしくなる

https://stackoverflow.com/questions/12358814/concatenating-strings-in-bash-overwrites-them #!/bin/sh str1="test1" str2="abcde" result=${str1}_${str2} echo $result result=$(echo ${str1} | tr -d '\r')_$(echo ${str2} | tr -d '\r') echo $resul…