<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="https://tm.root-n.com/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel>
        <title>Tipsというかメモ programming:shell_script:command</title>
        <description></description>
        <link>https://tm.root-n.com/</link>
        <lastBuildDate>Tue, 18 Nov 2025 15:38:32 +0900</lastBuildDate>
        <generator>FeedCreator 1.7.2-ppt DokuWiki</generator>
        <image>
            <url>https://tm.root-n.com/lib/images/favicon.ico</url>
            <title>Tipsというかメモ</title>
            <link>https://tm.root-n.com/</link>
        </image>
        <item>
            <title>シェルスクリプト :: getopts コマンド</title>
            <link>https://tm.root-n.com/programming:shell_script:command:getopts</link>
            <description># 各フラグを初期化
file= verbose= quiet= long=

while getopts f:vql opt
do
    case &quot;$opt&quot; in
    &quot;f&quot;) file=$OPTARG
       ;;
    &quot;v&quot;) verbose=true
       ;;
    &quot;q&quot;) quiet=true
       ;;
    &quot;l&quot;) long=true
       ;;
    esac
done

# オプションをすべて削除し、引数だけ残す
shift $((OPTIND -1 ))</description>
        <category>programming:shell_script:command</category>
            <pubDate>Sun, 16 Mar 2008 22:48:20 +0900</pubDate>
        </item>
        <item>
            <title>シェルスクリプト :: printf コマンド</title>
            <link>https://tm.root-n.com/programming:shell_script:command:printf</link>
            <description>右寄せ
% printf &quot;|%10s|\n&quot; hello
|     hello|




左寄せ
% printf &quot;|%-10s|\n&quot; hello
|hello     |




パディング
% printf &quot;%.5d\n&quot; 15
00015

% printf &quot;%05d\n&quot; 15
00015




文字数指定
% printf &quot;%.10s\n&quot; &quot;a very long string&quot;
a very lon</description>
        <category>programming:shell_script:command</category>
            <pubDate>Wed, 21 Apr 2010 10:27:30 +0900</pubDate>
        </item>
        <item>
            <title>シェルスクリプト :: read コマンド</title>
            <link>https://tm.root-n.com/programming:shell_script:command:read</link>
            <description>情報を読み込み、1つまたは複数の変数に値をセットする

例えば、下記のようなテキストファイル「profile.txt」があるとします。

1行1レコードで情報の内容は、名前, 性別, 生年月日, 血液型 となっています。</description>
        <category>programming:shell_script:command</category>
            <pubDate>Mon, 24 Oct 2011 10:24:45 +0900</pubDate>
        </item>
        <item>
            <title>シェルスクリプト :: test コマンド</title>
            <link>https://tm.root-n.com/programming:shell_script:command:test</link>
            <description>備忘録。

演算子tureが返される条件stringstringがnullでない場合-b filefileがブロックデバイスファイルの場合-c filefileがキャラクタデバイスファイルの場合-d filefileがディレクトリの場合-e filefileが存在する場合-f filefileが通常ファイルの場合-g filefileにsetgidビットがセットされている場合-h filefileがシンボリックリンクの場合-L filefileがシンボリックリンクの場合(-hと同じ)-n stringstringがnullでない場合-p filefileがFIFOファイルの場合-r filefileが読み取り可能な場合-S filefileがソケットの場合-s filefileが空でない場合-t nファイル記述子nが端末を指している場合-u filefileにsetuidビットがセットされている場合-x filefileが実行可能なファイルか検索可能なディレクトリの場合-w filefileが書き込み可能な場合-z stringstringがnullの場合s1 = s2文字列s1とs2…</description>
        <category>programming:shell_script:command</category>
            <pubDate>Sun, 16 Mar 2008 22:48:20 +0900</pubDate>
        </item>
        <item>
            <title>シェルスクリプト :: trap コマンド</title>
            <link>https://tm.root-n.com/programming:shell_script:command:trap</link>
            <description>シグナルと trap コマンド

シグナルとは、実行中のプロセスに対して、各種イベントを通知するために送出される合図(信号)です。

よく使用されるシグナルには、SIGTERM や SIGHUP、SIGKILL などがあります。

シグナルは全部で数十種類が存在します。</description>
        <category>programming:shell_script:command</category>
            <pubDate>Sat, 27 Feb 2010 16:02:34 +0900</pubDate>
        </item>
    </channel>
</rss>
