Deprecated: Array and string offset access syntax with curly braces is deprecated in /mnt/hep_web/hep_web/member/n-kota/dokuwiki/inc/init.php on line 542
ja:bash [GiriWiki]

ユーザ用ツール

サイト用ツール


ja:bash

以前のリビジョンの文書です



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の備忘録 ====== ---- * [[:ja:bash:stdouterror|標準出力・標準エラー出力]] * [[:ja:bash:WantToDo1|scriptがあるディレクトリの絶対パスをとる]] * [[:ja:bash:WantToDo2|1日前の日付を取得]] * [[:ja:bash:WantToDo3|aliasの一時解除]] * [[:ja:bash:WantToDo4|連番ファイルの後半だけ削除]] * [[:ja:bash:WantToDo5|変数から一部を抜き出す]] * [[:ja:bash:WantToDo6|macでsshのホスト名の補完など: bash-completion]] * [[:ja:bash:WantToDo7|変数を使って連番を生成]] ===== 変数を使って連番を生成 ===== 例えば1から10までの連番を生成してループを回したい時、 <code bash> for i in {1..10} do ... </code> の様にして連番生成、ループ処理を行うことができるが、この範囲を変数として <code bash> Start=1 End=10 for i in {${Start}..${End}} do ... </code> としてもiに{1..10}という文字列が格納されるだけで、展開されて連番を生成してくれない。 こんな時は、以下の様に"eval echo " を使う。 <code bash> Start=1 End=10 for i in `eval echo {${Start}..${End}}` do ... </code> これで、先のように1から10までの連番が生成される。

ja/bash.1504066300.txt.gz · 最終更新: 2017/08/30 04:11 by kota