以前のリビジョンの文書です
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in
/mnt/hep_web/hep_web/member/n-kota/dokuwiki/inc/parser/handler.php on line
1458
Warning: Declaration of syntax_plugin_note::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in
/mnt/hep_web/hep_web/member/n-kota/dokuwiki/lib/plugins/note/syntax.php on line
79
Warning: Declaration of syntax_plugin_note::render($mode, &$renderer, $indata) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in
/mnt/hep_web/hep_web/member/n-kota/dokuwiki/lib/plugins/note/syntax.php on line
101
Warning: preg_match(): Compilation failed: invalid range in character class at offset 3120 in
/mnt/hep_web/hep_web/member/n-kota/dokuwiki/inc/parser/lexer.php on line
118
A PCRE internal error occured. This might be caused by a faulty plugin
====== bashの備忘録 ======
----
===== 標準出力・標準エラー出力 =====
File Descriptorは
* 標準出力 : 1
* 標準エラー出力 : 2
===== scriptがあるディレクトリの絶対パスをとる =====
<code bash>
FILE_DIR=$(cd $(dirname $BASH_SOURCE); pwd)
</code>
* $BASH_SOURCE : scriptの絶対パス
* cd しているが、scriptの処理が終わった後には元のdirectoryに戻っている
===== 1日前の日付を取得 =====
<code bash>
date -d '1 days ago'
</code>
とする。1をNに変えれば、N日前。
===== aliasの一時解除 =====
\lsのように、コマンドの前に"\"をつければ良い。
===== 連番ファイルの後半だけ削除 =====
file_0.txt\\
file_1.txt\\
・\\
・\\
・\\
file_99.txt\\
があるうち、50−99までを削除したいとする。
''ls -v file_* | tail -n 50 | xargs rm ''
* ''ls -v file_*'' で数字順にls出力
* ''| tail -n 50''で前の出力の後ろ50を切り出す
* ''| xargs rm''で前の出力をパラメータとして受け取り、rmに渡している
はじめ、lsがaliasされてうまくいかなかったが"\ls"としてやるとうまくいった。