プロが教える店舗&オフィスのセキュリティ対策術

UNIX端末でCシェルのプログラムがあるのですが、今後UNIX端末を
廃棄して、WindowsのPCだけにするようなので、プログラムが使えなくなるのが困ります。

いくつかはVB2005でdosコマンドを使って作り直したのですが、今作ろうとしている物の中の
コマンドで調べても解らないのがありました。

echo(echo $a > sssやecho 'abc def' >> sss)
cat(set x = 'cat rrr')
paste(paste fff ggg > hhh)
などのコマンドと、あとawkがありました。

よろしくお願いします。

A 回答 (6件)

echo は DOS窓でも echo です。


cat => type
paste は 多分無いです。
awk も 多分無いです。
    • good
    • 0
この回答へのお礼

下の2つはないですか。
ありがとうございます。

お礼日時:2007/08/24 15:21

No.2です。



llって,'ls -al'あたりをaliasしているだけですよね?
汎用性がなくなるので,シェルスクリプトでaliasのコマンドは使わないほうが良いですよ。
    • good
    • 0

> cygwin.batを開いて「bash --login -i」を「tcsh --login -i」に


>してみたのですが、起動しなくなりました。

tcsh には --login なんてオプションがないから
エラーになって起動しなかっただけでは?

C:\cygwin>tcsh --login -i
Unknown option: `--login'
Usage: tcsh [ -bcdefilmnqstvVxX ] [ argument ... ].

C:\cygwin>tcsh --help
tcsh 6.14.00 (Astron) 2005-03-25 (i386-intel-posix) options 8b,nls,dl,al,kan,rh,
color,dspm

-b file batch mode, read and execute commands from `file'
-c command run `command' from next argument
-d load directory stack from `~/.cshdirs'
-Dname[=value] define environment variable `name' to `value' (DomainOS only)
-e exit on any error
-f start faster by ignoring the start-up file
-F use fork() instead of vfork() when spawning (ConvexOS only)
-i interactive, even when input is not from a terminal
-l act as a login shell, must be the only option specified
-m load the start-up file, whether or not owned by effective user
-n file no execute mode, just check syntax of the following `file'
-q accept SIGQUIT for running under a debugger
-s read commands from standard input
-t read one line from standard input
-v echo commands after history substitution
-V like -v but including commands read from the start-up file
-x echo commands immediately before execution
-X like -x but including commands read from the start-up file
--help print this message and exit
--version print the version shell variable and exit

See the tcsh(1) manual page for detailed information.
    • good
    • 0

No.2です。



シェルスクリプトの先頭行に
#!/bin/csh
と記述し,そのシェルスクリプトにchmodで実行権を与え,cygwinのコマンドプロンプトから当該シェルスクリプトを実行するだけです。

先頭行にcshで実行することが指定されているので,ログインシェルや現在のシェルをtcshにする必要はないです。

(てっきり/bin/tcshにしなきゃだめかと思いましたが/bin/cshのままで良いようですね)

この回答への補足

補足に書きましたように実行はできています。
tcshにしないとllなど使えないのがあるのです。

補足日時:2007/08/24 17:00
    • good
    • 0

http://www.google.co.jp/search?q=awk%20windows%E …
どうやらNo2の提案と同じになるっぽい
    • good
    • 0

Windowsマシンにcygwinをインストールするというのでは駄目ですか?



# bashなので cshスクリプトを動かすためにはインストール時にSelect Packagesでtcshを入れ,先頭行を #!/bin/tcsh に変更するなどの作業が必要ですが。(awkもデフォルトだと入らなかったかも...)

参考URL:http://www.cygwin.com/

この回答への補足

以前、これを試したのですが、うまくいかなくて挫折しました。
もう一度試してみて、gawkとtcshを入れてみました。
今作ろうとしてたのを動かしてみたら、動く事が確認できました。
#!cshのままです。

cygwinを起動するとbashのようで、毎回tcshにするのは面倒です。
cygwin.batを開いて「bash --login -i」を「tcsh --login -i」に
してみたのですが、起動しなくなりました。

補足日時:2007/08/24 15:31
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!