ファイル名の一部に、そのファイルを作成した日時を付けるには、バッククオートを使用する。バッククオートを使用すると、コマンドの出力を文字列として扱うことができる。そこで、バッククオートと日付を表示するdateコマンドを組み合わせれば、ファイル名に日付を入れることができるようになる。 まず、dateコマンドの出力結果について考えてみる。引数を指定しないでdateコマンドを実行すると、以下のような結果が表示される。
ファイル名の一部に、そのファイルを作成した日時を付けるには、バッククオートを使用する。バッククオートを使用すると、コマンドの出力を文字列として扱うことができる。そこで、バッククオートと日付を表示するdateコマンドを組み合わせれば、ファイル名に日付を入れることができるようになる。 まず、dateコマンドの出力結果について考えてみる。引数を指定しないでdateコマンドを実行すると、以下のような結果が表示される。
ユーザーの入力をカーネルに伝えまたその逆を行う、いわば両者の橋渡しを行うプログラムをシェルといいます。ユーザーから見てカーネルを包んでいる貝殻(shell)のように見えることからそう名付けられました。 シェルには多くの種類がありますが、Linuxにおけるデファクトスタンダードになっているbashについてどんな機能があるかを見ていきます。 補完 まず知っておきたい基本的な機能が補完です。コマンドプロンプトでTabキーを押すことで、コマンド名やファイル名を補完することが出来ます。 $ ls abc1 abc2 def $ cat a[Tab] $ cat abc 確定できる部分までが補完されました。ここからさらに2回Tabキーを叩くと候補が表示されます。 $ cat abc[Tab][Tab] abc1 abc2 リダイレクト・パイプ リダイレクトとパイプという機能を理解するにはプロセスがどの
2つの顔を持つソフトウェア:シェル ステップ・バイ・ステップ・シェルスクリプト(1) この連載では、シェルスクリプトで実用的なプログラムを組むことを目標にして、シェルの基本的な知識を説明していきます
The page you are trying to reach does not exist, or has been moved. Please use the menus or the search box to find what you are looking for.
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く