<?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:etc</title>
        <description></description>
        <link>https://tm.root-n.com/</link>
        <lastBuildDate>Tue, 18 Nov 2025 16:49:52 +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>シェルスクリプト :: 条件分岐 if</title>
            <link>https://tm.root-n.com/programming:shell_script:etc:condition_if</link>
            <description>記述式説明Aif [ -n “$str” -a -f “$file” ]1つの testコマンド、2つの条件Bif [ -n “$str” ] &amp;&amp; [ -f “$file” ]2つの testコマンド(短絡評価される)Cif [ -n “$str” &amp;&amp; -f “$file” ]構文エラー

A は、2つの条件が両方とも判定される。

B は、最初の条件が true の場合のみ、2つ目の条件が判定される。

C は、2つ目の処理中に -f というコマンドは存在しないというエラーが発生する。</description>
        <category>programming:shell_script:etc</category>
            <pubDate>Sun, 16 Mar 2008 22:48:21 +0900</pubDate>
        </item>
        <item>
            <title>シェルスクリプト :: 日付フォーマット</title>
            <link>https://tm.root-n.com/programming:shell_script:etc:date_format</link>
            <description>説明例%a曜日を省略形で表示するMon%A曜日を英語で表示するMonday%b月名を英語の省略形で表示するJan%B月名を英語で表示するJanuary%H現在時刻の時を24時間表示で示す0-23%I時刻の時を12時間表示で示す00-12%M現在時刻の分を表示する00-59%Pa.m.やp.m.を表示するa.m.%S現在時刻の秒を表示する00-59%X省略形の時刻10:20:35%Y西暦年を省略しないで表示する1998
cronで使用するときはエスケープした方が無難

例）/path/to/hoge/ に YYYYMMDD_HHMMSS.log で保存する…</description>
        <category>programming:shell_script:etc</category>
            <pubDate>Sun, 16 Mar 2008 22:48:21 +0900</pubDate>
        </item>
        <item>
            <title>シェルスクリプト :: 関数</title>
            <link>https://tm.root-n.com/programming:shell_script:etc:function</link>
            <description>他のプログラミング言語同様、ある特定の処理をまとめて記述したブロックが関数。

スクリプト中であれば、どこからでも、何度でも呼び出すことができる。

ただし、シェルスクリプトの関数定義は、実際に呼び出される前に定義しておかなければならない。

よくある手法として . (ドットコマンド) で、別ファイルに定義された関数をスクリプトの先頭部で読み込むことも多い。…</description>
        <category>programming:shell_script:etc</category>
            <pubDate>Sun, 16 Mar 2008 22:48:21 +0900</pubDate>
        </item>
        <item>
            <title>シェルスクリプト :: シェルスクリプトのセキュリティーを高める</title>
            <link>https://tm.root-n.com/programming:shell_script:etc:security</link>
            <description>シェルスクリプトのセキュリティーを高める TIPS を3つ紹介します。

以下のソースをシェルスクリプトの冒頭部に`必ず書く'ことで、セキュリティーを高めることができます。

各行については、順を追って説明します。</description>
        <category>programming:shell_script:etc</category>
            <pubDate>Sun, 16 Mar 2008 22:48:21 +0900</pubDate>
        </item>
    </channel>
</rss>
