![]() |
|
|
Googleのunix.com
|
|||||||
| シェルプログラミングとスクリプティング KSH 、 CSH 、 shに、 bashの、はPerl 、 PHPは、削除するsed 、 Awkの、他のシェルスクリプトやシェルスクリプト言語についての質問の投稿はこちら。 |
その他のUNIXおよびLinuxフォーラムトピックは参考にすること
|
||||
| スレッド | スレッドスターター | フォーラム | 返信 | 最後の投稿 |
| 2つのファイルに文字列を比較する | MiLKTea | シェルプログラミングとスクリプティング | 2 | 2008年3月10日 05:35午前 |
| 場合は、文字列が含まれ、特定のパターンを知る方法 | ディアン | シェルプログラミングとスクリプティング | 11 | 2007年8月9日 09:19午後 |
| 文字列を比較する | sbasetty | シェルプログラミングとスクリプティング | 14 | 2007年2月7日 05:24午前 |
| 文字列に文字を比較 | フォボス | 高レベルのプログラミング | 3 | 2005年4月9日 12:01午後 |
| 文字列を比較する | gundu | シェルプログラミングとスクリプティング | 3 | 2005年3月23日 04:42午後 |
![]() |
|
|
LinkBack | スレッドツール | このスレッドを検索 | スレッドを評価 | 表示モード |
|
|
|
|||||
|
やあ。 でアットホームな雰囲気をする: コード:
#!/usr/bin/env rexx
/*
# @(#) s1 Demonstrate Linux rexx.
*/
subject = 'We are looking for an item in a line.'
If WORDPOS('item', subject) > 0 Then
SAY 'Found it.'
Else
SAY ' Cannot see item.'
exit 0
生産: コード:
% ./s1 Found it. 私自宅で気分にさせる: コード:
#!/bin/bash -
# @(#) s1 Demonstrate rexx function emulation.
debug="echo"
debug=":"
wordpos() {
local phrase="$1" string="$2"
$debug " wordpos, looking for $phrase in $string"
if [[ $string == *$phrase* ]]
then
return 0
else
return 1
fi
}
if wordpos item "Jack and Jill"
then
echo " Found it (unexpected!)."
fi
if wordpos item "Now here is an item embedded."
then
echo " Found it (expected)."
fi
exit 0
生産: コード:
% ./s2 Found it (expected). s2の鍵の機能はもちろん、ない場合は、その構文とは もし 声明。このページで http://www.tldp.org/LDP/abs/html/index.html 長いですが、貴重な...歓声、 drl |