【sed】sedで変数を使う場合、変数自体をシングルクォートで囲う

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
yuta@DESKTOP-V36210S:/mnt/c/yuta$ word=klmno # 変数が展開されない yuta@DESKTOP-V36210S:/mnt/c/yuta$ cat test.txt | sed '$a $word' abcde fghij $word yuta@DESKTOP-V36210S:/mnt/c/yuta$ # 変数がされる yuta@DESKTOP-V36210S:/mnt/c/yuta$ cat test.txt | sed '$a '$word'' abcde fghij klmno yuta@DESKTOP-V36210S:/mnt/c/yuta$ yuta@DESKTOP-V36210S:/mnt/c/yuta$ |
2 Comments
2 Records
210seikatsu wrote:
知りたかったのはまさにこれですこれ!感謝!
yuta wrote:
とんでもありません!