ユーザ用ツール

サイト用ツール


tipsmemo:tips:shellscript

差分

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

この比較画面へのリンク

次のリビジョン
前のリビジョン
最新のリビジョン両方とも次のリビジョン
tipsmemo:tips:shellscript [2019/12/02 02:11] – 作成 hayashitipsmemo:tips:shellscript [2021/01/18 09:33] – [連番のゼロパディング] hayashi
行 1: 行 1:
 ====== Shellscript ====== ====== Shellscript ======
 +
 +===== 連番のゼロパディング =====
 +
 +  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.txt · 最終更新: 2021/02/24 05:40 by hayashi