ユーザ用ツール

サイト用ツール


tipsmemo:tips:shellscript

差分

このページの2つのバージョン間の差分を表示します。

この比較画面にリンクする

次のリビジョン
前のリビジョン
tipsmemo:tips:shellscript [2019/12/02 11:11]
hayashi 作成
tipsmemo:tips:shellscript [2021/02/24 14:40] (現在)
hayashi
行 1: 行 1:
 ====== Shellscript ====== ====== Shellscript ======
 +===== コマンド出力を直接diff =====
 +**bash**
 +  diff <(command1) <(command2)
 +
 +**bin/sh**
 +  command1 | ( command2 | diff /dev/fd/3 -) 3<&0
 +
 +===== 連番のゼロパディング =====
 +
 +  seq -f %05g 1 10
 +
 +ただし、桁数が増えると指数表現になるので、その場合はフォーマットをfにして小数点部分を削る
 +
 +  seq -f %08f 1 10000000 | sed -e "s/\.000000//"
 +
 +===== 正規表現 =====
 +
 +  * [[http://www.kt.rim.or.jp/~kbk/regex/regex.html|正規表現メモ]]
 +  * [[https://qiita.com/richmikan@github/items/b6fb641e5b2b9af3522e|どのUNIXコマンドでも使える正規表現]]
 +
 +===== ssh接続テスト =====
 +  echo "hostname"; ssh -q -T -o "PasswordAuthentication no" -o "StrictHostKeyChecking no" -i .ssh/id_rsa user@host ":" && echo "OK" || echo "NG"
  
tipsmemo/tips/shellscript.1575252663.txt.gz · 最終更新: 2019/12/02 11:11 by hayashi