|
Hmm... I have recovery FreeBSD. But canna server doesn't accept a connection. Something is wrong. sign.... @moriya I can't understand what you want to say. Please show examples of the file and the record. To know OS version, type `uname -a'. @Q > get MX record without Net::DNS There is a sample script to get MX with nslookup. http://X68000.startshop.co.jp/~68user/cgi-bin/view-script.cgi/expn.cgi Another way, connect DNS server (port 53/udp), talk DNS protocol. # I hate multipost. You have to reply in 2ch, don't you? |
|
説明不足で申し訳ありませんでした。 org.datというファイルがあるとします あと、tencd.txtというテキストファイルがあり、その中身は 000420000101 002320001010 034320001020 とします この場合、 org.datをコピーしてorg004.dat、org0023.dat、org0343.dat という3つの複製ファイルを作成したいのです。 tencd.txtは何レコードあるかは不定です。 因みにHP-UXのバージョンはB.10.20でした。 よろしくお願いします |
|
What do you mean? hahaha... |
|
sh なら exec < tencd.txt while read line do set -- $line num=`echo $line | sed 's/^\(....\).*/\1/'` cp org.dat org$num.dat done csh なら foreach line (`cat tencd.txt`) set num=`echo $line | cut -c-4` cp org.dat org$num.dat end てな感じでしょうか。 # シェルスクリプトと言っても、シェルにはいろいろ種類が # あるので、sh か csh かそれ以外かを明記してください。 先頭4バイト取得には、sed でも cut でも awk でも お好きな方法をどうぞ。 もちろん全体を awk スクリプトで書くこともできます。 でもまぁ、perl を覚えた方がよいとは思いますね。 |