2009年9月17日木曜日

CによるCGI作成

※この説明はRedhatLinuxV8.0を元にしている。


サーバ側:受信データの取得(環境変数取得)
    これが受信文字列取得&変数代入。
    書式と変数を増やすだけで、引数の増加に対応可能。 '&%*[^=]=%[^&]' が追加単位。
    書式が入力されるデータの数より多い場合、あまった書式指定は無視されるので、大らかに行きましょう。

    sscanf( getenv("QUERY_STRING"),
        "%*[^=]=%[^&]&%*[^=]=%[^&]&%*[^=]=%[^&]&%*[^=]=%[^&]&%*[^=]=%[^&]&%*[^=]=%[^&]",
        strP1r, strP2, strP3, strP4, strP5, strP6
    );


サーバ側:特定プロセスの状態(StartOrStop)確認
    (例はntpサーバデーモン)
    popen( )を使用することで、grep結果を仮想ファイルに吐き出して、それを読み込んで処理する。

    if( (pFile = popen( "ps -ef |grep ^ntp", "r" ) ) == NULL ){
        fprintf( stderr, "error!\n" );
        exit( -1 );
    }
    sprintf( statusNtp, "dead" );
    while( fgets( strLine, 128, pFile ) ){
        if( 0 == strncmp( strLine, "ntp", 3 ) ){ /* ntpd is Alive */
            sprintf( statusNtp, "alive" );
            break;
        }
    }
    pclose( pFile );


サーバ側:管理者権限コマンドの実行
    ntpサーバのリブート

    1.一般ユーザにて、シェルにリブートコマンドを渡すプログラム作成。
        suNtpReboot.c
            main(){
                setuid( 0 );
                setgid( 0 );
                system( "/etc/rc.d/init.d/ntpd restart" );
            }

    2.rootに切り替え

    3.コンパイル結果のオーナーを変更
        chown root suNtpReboot.o

    4.パーミッション変更
        chmod +s suNtpReboot.o

    5.CGIから実行
        system( "/var/www/cgi-bin/suNtpReboot.o" );


クライアント側:JavaScript-特定画面のリロード

    puts( "\n"
        "
        -->\n\n"
    );



クライアント側:JavaScript-よくある、うるう年チェック

    printf("// 2(Feb.) Proc\n");
    printf("if( document.form.dateMonth.value == 2 ){\n");
    printf("    // LeapYear Check\n");
    printf("    if( ( (( document.form.dateYear.value % 4 ) == 0 )\n");
    printf("      &&(( document.form.dateYear.value % 100 ) != 0 ) )\n");
    printf("              ||\n");
    printf("        ( ( document.form.dateYear.value % 400 ) == 0 )\n");
    printf("    ) { // LeapYear Proc\n");
    printf("        if( document.form.dateDay.value > 29 ){\n");
    printf("            alert(\"指定された月の日数は29日までです\");\n");
    printf("            return false;\n");
    printf("        }\n");
    printf("    } // End of LeapYear Proc\n");
    printf("else{ // Non-LeapYear Proc\n");
    printf("    if( document.form.dateDay.value > 28 ){\n");
    printf("        alert(\"指定された月の日数は28日までです\");\n");
    printf("        return false;\n");
    printf("    }\n");
    printf("    } // End of Non-LeapYear Proc\n");
    printf("} // End of 2(Feb.) Proc\n");

-eod-

英文法の覚え書き

英文法の基礎
出典:
Margaret Shertzer著
The Elements of Grammar

CHAPTER ONE

はじめに…
(意図的空白)

CHAPTER TWO

Some Grammatical Terms

noun:名詞

とくに説明無し

pronoun:代名詞

「これのあれは、それかい?」←代名詞のみです。
case:格
 nominative(主格):used for the subject of the sentence (or clause)
  I, you, she, he, it; we, you, they
 possessive(属格):showing who owns something
  my, mine, your, yours,his, her, hers, its, our, ours, their, theirs
 objective(目的格):receiving the action of the verb (or preposition)
  me, you, her, him, us, them
英語には上記3つ、ラテン語には、主格・呼格・属格・与格・対格・奪格の六つの格があるそうな。

verb:動詞

とくに説明無し

adjective:形容詞

とくに説明無し

adverb:副詞

対象となる行動(verb)が、どの様に・いつ・どこで、またはどれくらいの規模で行われたかを説明します。

preposition:前置詞

とくに説明無し

conjunction:接続詞

とくに説明無し


CHAPTER THREE

Points of Grammar
(断定調で記述しているが、例外あり)
■名詞の複数形
1.単数形に s を付ける
banks chemists hospitals letters
2.f, fe, および ff で終わる名詞
通常 s を付ける
briefs chiefs giraffes plaintiffs proofs scarfs sheriffs tariffs
f および fe で終わる名詞には、v に置き換えて es を付けるものも有る
halves knives leaves lives selves shelves thieves wives
3.s, sh, ch, x, および z で終わる名詞
es を付けて音節を増やします。元も名詞の発音への影響をなくします。
annexes brushes businesses chintzes churches dishes dispatches
hoaxed lunches quartzes sixes taxes waltzes waxes witnesses yeses
4.y で終わる名詞
y の直前が子音の場合、y→i そして es を付けます。
companies fallacies parties vacancies
y の直前が母音の場合、(quy でなければ)s を付けます。
attorneys journeys keys valleys
5.o で終わる名詞
s もしくは es を付けます。ただし例外も多くあります。
直前も母音の場合、単数形に s を付けます。
cameos studios
直前も子音の場合、単数形に es を付けます。
embargoes torpedoes
But: pianos, solos, tobaccos
どちらも許されているのもあります。
cargos or cargoes
mottos or mottoes
zero or zeroes
6.途中の母音を変えることで、複数形をとる名詞も有ります
feet geese men mice teeth women
7.複数形・単数形が同じものもあります。
deer grass
でも、‘いくつかの種類’をあらわす場合、複数形となります。
the deers of North America
grasses found on the prairies
8.複数形のみの名詞も有ります。
ただし、性質や形体を変えて、存在するかもしれません。
(言葉の海は広いし…)
ceramics goods pants scales scissors trousers
9.単数形(または複数形)を取る・取らないで意味が変わるものもあります。
Athletics(体育) is part of the school program.
Athletics(スポーツ) are popular with our students.
10.複数形が2つ存在するものがあります。意味が違ってきます。
cloths(布きれ)
clothes(いわゆるアパレル素材)
11.単数扱いの複数形があります。
economics news
12.複合名詞(複数単語からなる名詞)は、
無くなってしまうと意味をなさなくなる方の単語を
複数形にします。
governors general
vice presidents
名詞が、前置詞、前置詞句または副詞とつながっている場合
名詞を複数形にします。
bills of lading
brothers-in-law
listeners-in
works of art
ただし、単一の名詞を形作っている場合、
通常のルールに従います。
businessmen
stockholders
weekends
最初の要素が、動詞からの派生ならば、
最後の要素を複数形化します。
go-betweens handouts makeups runaways shut-ins
13.
14.
15.
16.
■代名詞
1.~14.
■動詞
1.~24.
■形容詞と副詞
1.~22.
■前置詞
1.~4.
■接続詞
1.~3
■従属節
1.2.

CHAPTER FOUR

大文字

CHAPTER FIVE

句読法

■ピリオド
■カンマ
■セミコロン
■コロン
■クエスチョンマーク
■エクスクラメーション
■アポストロフィ
■クォーテーションマーク
■ダッシュ
■括弧パレンシーズ
■鉤括弧ブラケッツ
■省略表現
■ハイフンによる複合
■複合の例
■単語の分割
■イタリック体の使用


CHAPTER SIX

数値の表記

表記を単語にするか、数字にするかは
要求される精度や使われる場面によります。
あらたまった席などでは、単語で表記される傾向があります。
(株主総会はさすがに、違うと思いますが)
ビジネス文章や雑誌などでは、数字表記が使われる傾向にあります。
(正確さ、だけでなく表記が簡潔にする目的)

1.数値の丸め。数値の範囲

概算やある範囲の数値を表すとき単語表記します。
as, four or five feet, seven hundred miles,
a thousand reasons, almost a million board feet of lumber,
a man in his eighties.
(雑誌ではこの限りではありません)

2.文頭が数値

単語表記します。続いて現れる数値が数字表現であってもです。
Two carloads of new, sample-garade corn were received here today and
sold at 85 to 99 cents a bushel.
Twenty members were present at last month's meeting.


桁の多い数値が文頭にきてしまう場合、
文を組みなおします。
Not: 1,625 pairs of shoes were destroyed in the fire.
Better: The fire destroyed 1,625 pairs of shoes.
Not: 135 employees will retire this year.
Better: This year 135 employees will retire.


3.文中の数値

1・2語で表記できる数値の場合
書籍では
It is estimated that there may be up to
thirty-nine bankruptcies per thousand businesses in this area.
報告書では
The subsurface formation ranges between depths of 3 and
34 feet from the ground surface.


桁数の大きい数値の場合
(調べた範囲では1000未満・以上が境目)
数字を使います。
The hotel received the record number of 3,138 requests for
reservations this year.
His house was sold for $91,500.


関連する数値は、単語・数字ともに統一します。
(前出の、文頭数値は除外)
They employed 10 women for 3 weeks at $200 a week.
Or:
They employed ten women for three weeks at two hundred dollars a week.


対象の異なる数値(時間、個数)が
同じ表記で、隣り合わないようにしましょう。
ダメじゃん: In 1981 15 states ratified the law.
良い: In 1981 fifteen states ratified the law.
イイっか:In 1981, 15 states ratified the law.
ダメじゃん:2 3-bedroom apartments, 3 $2 bets
良い:two 3-bedroom apartments, three $2 bets


個数が、別の数値の直前にある場合
単語表記の短い方を、単語表記します。
ten 3-inch nails, 20 six-foot poles.


4.日付

10年期・100年期(世紀)
単語表記します。(例外は有ると思いますが)
the gay nineties, the nineteenth century.


5.年期

お付き合いでの文書では、単語表記します。
(結婚式の招待状など)
nineteen hundred and sixty-nine
法的文書などでは
one thousand nine hundred and sixty-nine
※会話の場合、1900年代は
前の言い方をする教師が多かったのですが
2000年代は、どうなんでしょう。
しばらくは、後の言い方が簡潔になるのですが。


ビジネスレター
原則、数字表記です。
January 27, 1986

ですが、ヨーロッパや軍事施設の慣わしとして
27 January, 1986


ビジネスレターの本文にて
月が日の前にくる場合、日を数字で表記します。
ただし -st, -d, or -th を付けません。
appointment for January 22.
Not: January twenty-second, January 22d


月が日の後にくる場合、日を単語表記か
-st, -d, or -th を付けます。
appointment for the twenty-second of January
or
appointment for the 22d of January


6.時間

数字表現のとき、a.m.(A.M.) または p.m.(P.M.)を付けます。
1:30 a.m. 1:30 p.m. 1:30 A.M.
時間が単語表記の場合、付けません。
誤: The train left at three p.m.
正: The train left at three in the afternoon.


対になる時間が時間:分で表記されている場合。
表記をあわせます。
He will be on duty from 8:00a.m. to 4:30 p.m.


7.通り

単語表記します。
Forty-second Street, Sixth Avenue, Thirteenth District


8.ページ

数字表記します。
page 3, page 533

9.(意図的空白)



10.



11.分数

単独で書かれる場合、単語表記します。
half a mile, a quarter of an ounce, a one-third interest
小数点数字での表記が可能な場合、混合させません。
20.5 miles
(Not: 20 and a half miles, 20 1/2 miles)


形容詞としての使用には、ハイフンを入れます。
a two-thirds vote, one-half inch
ただし、名詞としての表現にはハイフンをいれません。
one sixth of the estate, two fifths of the field


…といっても、ビジネス文書を中心に
両方の場合共、ハイフンを入れる傾向に有ります。
a one-third interest in the estate
one-third of the estate


一般に、分数を数字表記する場合
of a(of an)は付けません。
3/8 inch (Not: 3/8 of an inch)
2/3 cup (Not: 2/3 of a cup)
0.5 percent (Not: 1/2 of 1 percent)


順番を表す、-nd, -th またはths は付けません。
6/100 (Not: 6/100ths)
4/1,000 (Not: 4/1,000ths)
1/32 (Not: 1/32nd part)
1/16 (Not: 1/16th)


整数と分数が連続している場合
ハイフンでなく、空白を入れます。
33 1/3 (Not: 33-1/3)


分数が、製品の仕様として使われる場合
ハイフンを入れます。そして製品は単数扱いです。
a 1/2-inch pipe
a 1/4-inch belt
a .22-caliber rifle


12.年齢

通常、数字で表記します。
My age is 52 years, 6 months, 10 days
a boy 6 years old
3-year-old colt
2-month-old child
改まった文書や「年代」として扱う場合
単語表記します。
eighty years and four months old
children between six and fourteen
a man in his forties


13.投票結果(無記名)

数字で表記します。
38 for, 25 against;
yeas 56, nays 24.


14.体積

通常、演算記号でなく単語を使用します。
10 by 15 inches,
(Not: 10 x 15 inches, 10" x 15")
技術書などでは、
by→x
feet→'
inches→" を使用します。
feet, inchesの略称表記を使用する場合
大文字化しません
ft. in.


15.距離

数字で表記します。
16 miles, 12 yards, 3 feet;
ただし、マイルの部分表記は単語にします。
but one-half mile.(形容詞的表現だから当たり前か)


16.量

数字で表記します。
10 gallons, 4 quarts, and 3 pints;
60 bushels, 5 pecks.
通常、該当する略称を使います。
6 lbs. 3 oz.


17.温度

数字で表記し、温度記号を付加します。
45℃


18.重さ

数字で表記
2 tons, 40 pounds, 10 ounces.

19.(意図的空白)


20.ローマ数字

算盤(そろばん)珠のパターンを
イメージするとわかり易い?

1────────────Ⅰ
2────────────Ⅱ
3────────────Ⅲ
4────────────Ⅳ
(五より一少ない)
5────────────Ⅴ
6────────────Ⅵ
(五より一多い)
7────────────Ⅶ
8────────────Ⅷ
9────────────Ⅸ
(十より一少ない)
10───────────Ⅹ
11───────────ⅩⅠ
(十より一多い)
14───────────ⅩⅣ
18───────────ⅩⅧ
19───────────ⅩⅨ
(十と九)
20───────────ⅩⅩ
(二つの十)
30───────────ⅩⅩⅩ
(三つの十)
40───────────ⅩL
(五十より十少ない)
50───────────L
60───────────LⅩ
(五十より十多い)
70───────────LⅩⅩ
80───────────LⅩⅩⅩ
90───────────ⅩC
100──────────C
200──────────CC
300──────────CCC
400──────────CD
500──────────D
600──────────DC
700──────────DCC
800──────────DCCC
900──────────CM
1,000────────M
2,000────────MM
3,000────────MMM
              _
4,000────────MV
             _
5,000────────V(Vの上 にダッシュ)
1928─────────MCMⅩⅩ Ⅷ (千 と九百と二十と八)

1930─────────MCMⅩⅩⅩ 
(千と九百と三十)
             
_
1,000, 000────M(Mの上にダッシュ)

CHAPTER SEVEN

綴りと語の選択

CHAPTER EIGHT

Sighs and Symbols
' acute accent
* asterisk, a mark used to denote a reference
@ at, about
[ ] brackets
^ カレット、キャレット caret. 校正での文字挿入指 示
" インチ inches; as,10'16"(ten feet, sixteen inches)
' フィート feet; as ,10'. フィートalso minutes; as, 6'.
` grave accent
# number; as, #7. シャープ(♯)ではあ りません。
~ チルダ tilde, a mark placed over n in Spanish words to denote the addition of the sound of y; as can~on pronounced canyon

ラテンな語
annus mirabilis Wonderful year
arbiter elegantiae A judge in matters of taste
bona fides Good faith
carpe diem Enjoy the present
casus belli A cause justifying war
causa sine qua non An indispensable condition
cave canem Beware of the dog
caveat emptor Buy at your own risk
cui bono? For whose advantage
de facto In reality, actually existing
de gustibus non est disputandum There is no disputing about tastes
de mortuis nil nisi bonum Concerning the dead say nothing but good
Dei gratia By the grace of God
Deo gratias Thanks to God
Deo juvanti With God's help
Deo volente(D.V.) God willing
Deus vobiscum God be will you
dis aliter visum It seemed otherwise to the gods
Dominus vobiscum The Lord be with you
dulce et decorum est pro patria mori Sweet and seemly is it to die for one's country
ecce homo Behold the man
ex cathedra Officially,
with authority
ex more According to custom
facile princeps Easily the first
fidus Achates Faithful Achates;
trusty friend
gaudeamus igitur Let us be joyful
genius loci The spirit of the place
hic et ubique Here and everywhere
hic sepultus Here lies buried
hinc illae lacrimae Hence those tears
hoc anno In this year
humanum est errare To err is human
in extremis At the point of death
in hoc signo vinces By this sign you will conquer
in loco parentis In the place of a parent
in medias res Into the midst of things;
into the heart of the matter
in omnia paratus Prepared for all things
in perpetuum Forever
in propria persona In one's own person
in rerum natura In the nature of things
in situ In its place; in proper position
in satu quo In the state in which it was before
in toto Altogether; entirely
in transitu In transit
ipso jure By the law itself
jure divino By devine law
jus canonicum Canon law
justitia omnibus Justice for all
labor omnia vincit Labor conquers all things
laborare est orare To work is to pray
laus Deo Praise be to God
loco citato In the place cited
locus in quo Place in which
locus sigilli The place of the seal
loquitur He (or She) speaks
mens sana in corpore sano A sound mind in a healthy body
meum et tuum Mine and thine
miles gloriosus A braggart soldier
mirabile dictu Wonderful to say
mirabilia Miracles
modus operandi A mode of operating
morituri te salutamus We who are about to die salute thee
motu proprio Of one's own accord
multum in parvo Much in little
mutatis mutandis The necessary changes having been made
mutato nomine The name having been changed
nemine contradicente No one contradicting
nemine dissentiente No one dissenting
nemo me impune lacessit No one attacks me with impunity
nihil Nothing
nil admirari To wonder at nothing
mil desperandum Nothing to be despaired of
nolens volens Whether willing or not
non possumus We are not able
nunc Now
obiit He died; she died
O tempora! O mores! O times! O customs!
omnia vincit amor Love conquers all
opere citato In the volume cited
otium cum dignitate Leisure with dignity
pari passu With equal place; without partiality
passim Here and there
pater patriae Father of his country
paucis verbis In few words
pax vobiscum Peace be with you
persona grata An acceptable person
pleno jure With full authority
primus inter pares First among equals
pro bono publico For the public good or welfare
pro Deo et ecclesia For God and the chrch
pro forma As a matter of form
pro memoria For memory
pro tempore Temporarily; for the time being
quantum sufficit As much as suffices
quo animo? With what spirit or intention?
quo Fata vocant Whither the Fates call
quo jure? By what right?
quo modo? In what way?
quod erat demonstrandum Which was to be shown
requiescat in pace May he (or she) rest in peace
scripsit He or she wrote (it)
sculpsit He or she sculptured (it)
secundum According to
semper idem Always the same
semper paratus Always ready
seriatim In a series
sic passim So throughout
sic semper tyrannis Thus always to tyrants
sic transit gloria mundi Thus passes away the glory of the world
sine die Without fixing a day for future action or meeting
sine qua non Something essential
summum bonum The highest or chief good
suo jure In one's own right
suo loco In one's own or rightful place
suum cuique To each his own
tempora mutantur, nos et mutamur in illis Times change and we change with them
tempus fugit Time flies
timeo Danaos et dona ferentes I fear the Greeks even when they bear gifts
ubique Everywhere
ut dict. As directed
vade mecum Go with me; companion
vae victis Woe to the conquered
vale Farewell
verbatim et literatim Word for word and letter for letter

2009年8月30日日曜日

ベリーダンス


ベリーダンスはオスマン朝時代のトルコが起源とされている。
この踊りは、ハーレム内の女たちへの余興として、招かれた踊り子と楽団により行われたそうだ。
そう、ベリーダンスは殿方向けでは無かったのだ。

また、この踊りがハーレムの外で披露されることは無かった。
それは信仰上の理由で、女性が公の場で踊ったり、劇場などで演ずることを禁じられていたからである。
(公の場への女性参加が制限されていたのは、当時日本を含む他の地域でも同じであろう)

だが、やがて踊り自体はハーレムから外へ広まるようになる。
結婚式や集会など、男女が集まる場において、まず踊られた。
ただし、信仰上の制限は依然あるので、(見目麗しい)少年が、踊ったそうだ。
※(資料ではgirlish boys)となっている。それはソレで気になるが…
彼らは、Kocek と呼ばれていたそうだ。

オスマン朝時代が終わり、トルコが共和国になると
これまでの制約がなくなり、ベリーダンスは女性によって踊られる事となる。
(Kocekは廃業したのだろうか? 芸の継承は無かったのか?…気になる)
そしてこの時期に、ベリーダンスの特徴的な衣装は形作られた。

同時に、オスマン朝時代にその影響下にあった地域でもベリーダンスは広まっていった。


この情報はベリーダンス音楽のCDから訳したものです。
ネット上での、裏付けを思いましたが、多くはありませんでした。

Jasmin Jahal
とりあえず総合的な情報を仕入れてみました

The Turkish Emporium
あのコスチュームが気になって…

Costume Goddess
気になって…

━以上━

CSVファイル内の特定項目に重複があるかチェックする


@echo off
:: *---------------------------------------------------------------------------
:: * WINDOWSバッチプログラム
:: * CSVファイル内の特定項目に重複があるかチェックする
:: * 
:: * 例として、各行の第2項目をチェック対象とする
:: * 第2項目の、カラム位置は(1オリジンで)12桁目から始まるものとする
:: * (11桁目がカンマとなる)
:: * 第2項目に英文字が使用されている場合は、
:: * 大文字・小文字どちらかに統一されているものとする
:: * 
:: * ■動かしてみたが、5000行で15秒以上かかって使い物にならない。
:: * 他に流用できそうな個所があるかもしれないので、残しておく。
:: * 
:: * ■ちなみに、Linux上で実装すると1行で完結する。
:: * sed 's/^.*,//' | sort | uniq --repeated --count
:: * そして、900000行を5秒程で処理できる………
:: * 
:: * ■↑パフォーマンスはPC依存ですよ
:: * 
:: *---------------------------------------------------------------------------


                            :: * ----------------------------------------------
                            :: * 変数初期化
                            :: * ----------------------------------------------
                            :: * 比較文字列バッファ
set PREV_STR=InitialDummyString
                            :: * 重複カウンタ
set /a V_COUNT_DUP=0
                            :: * 重複カウンタ合算。終了メッセージ切り分け用
set /a V_COUNT_DUP_TOTAL=0

                            :: * ----------------------------------------------
                            :: * 入力引数の有無確認
                            :: *   無ければ、プログラム説明を表示して終了
                            :: * ----------------------------------------------
if "" == "%1" goto SETSUMEI_DE_OWARI


                            :: * ----------------------------------------------
                            :: * ファイル内容のソート
                            :: *   各行の12桁目からの文字列が対象
                            :: * ----------------------------------------------
                            :: * 行の内容を分解して、
                            :: * 引数としてサブルーチンに渡す。
                            :: *   セパレータはカンマ
                            :: *   第1項目と第2項目を取得して
                            :: *   第1項目→%%L
                            :: *   第2項目→%%Mに取得するが、
                            :: *   サブルーチン渡すのは%%M(第2項目)のみ
                            :: * ----------------------------------------------
for /f "delims=, tokens=1-2"  %%L in ( 'sort /+12 %1' ) do call :SUB %%M
goto OK_NG_CHECK


                            :: * ----------------------------------------------
                            :: * サブルーチン
                            :: * ----------------------------------------------
:SUB
if "%PREV_STR%" NEQ "%*" (
    set PREV_STR=%*
    if %V_COUNT_DUP% GEQ 1 (
        echo 重複が切れました
        echo 重複項目名:%PREV_STR% 重複回数:%V_COUNT_DUP%
        set /a V_COUNT_DUP=0
    )
) else (
    echo 重複が継続中
    set /a V_COUNT_DUP+=1
    set /a V_COUNT_DUP_TOTAL+=1
)
goto EOF


                            :: * ----------------------------------------------
                            :: * プログラム説明を表示して終了
                            :: * ----------------------------------------------
:SETSUMEI_DE_OWARI
echo.
echo ここに説明を記述する
goto EXIT


                            :: * ----------------------------------------------
                            :: * チェック結果の判定
                            :: * ----------------------------------------------
:OK_NG_CHECK
                                :: * ------------------------------------------
                                :: * ファイル内最終行での重複を
                                :: * 取りこぼさない様に個別チェック
                                :: * ------------------------------------------
if %V_COUNT_DUP% GEQ 1 (
    echo 重複項目名:%PREV_STR% 重複回数:%V_COUNT_DUP%
)
                                :: * ------------------------------------------
                                :: * 結果判定と、メッセージ切り替え
                                :: * ------------------------------------------
if %V_COUNT_DUP_TOTAL% GEQ 1 (
    echo ▲上記のとおり、重複がありました▲▲▲
) else (
    echo △重複はありませんでした△△△△△△△
)


                            :: * ----------------------------------------------
                            :: * 終了
                            :: * ----------------------------------------------
:EXIT
echo.
echo 終了します、何かキーを押してください。
pause > NUL
echo on

特定ソフトのインストール有無を確認する


例:PCにcygwinがインストールされているか
実行パスから調べる。

set Path | findstr /c:"cygwin" > NUL

if "%errorlevel%" == "0" (
   :: 見つかった場合の処理
)else(
   :: 見つからなかった場合の処理
)