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がありました。
よろしくお願いします。
No.6
- 回答日時:
No.2です。
llって,'ls -al'あたりをaliasしているだけですよね?
汎用性がなくなるので,シェルスクリプトでaliasのコマンドは使わないほうが良いですよ。
No.5
- 回答日時:
> 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.
No.4
- 回答日時:
No.2です。
シェルスクリプトの先頭行に
#!/bin/csh
と記述し,そのシェルスクリプトにchmodで実行権を与え,cygwinのコマンドプロンプトから当該シェルスクリプトを実行するだけです。
先頭行にcshで実行することが指定されているので,ログインシェルや現在のシェルをtcshにする必要はないです。
(てっきり/bin/tcshにしなきゃだめかと思いましたが/bin/cshのままで良いようですね)
No.2
- 回答日時:
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」に
してみたのですが、起動しなくなりました。
お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!
関連するカテゴリからQ&Aを探す
おすすめ情報
- ・漫画をレンタルでお得に読める!
- ・街中で見かけて「グッときた人」の思い出
- ・「一気に最後まで読んだ」本、教えて下さい!
- ・幼稚園時代「何組」でしたか?
- ・激凹みから立ち直る方法
- ・1つだけ過去を変えられるとしたら?
- ・【あるあるbot連動企画】あるあるbotに投稿したけど採用されなかったあるある募集
- ・【あるあるbot連動企画】フォロワー20万人のアカウントであなたのあるあるを披露してみませんか?
- ・映画のエンドロール観る派?観ない派?
- ・海外旅行から帰ってきたら、まず何を食べる?
- ・誕生日にもらった意外なもの
- ・天使と悪魔選手権
- ・ちょっと先の未来クイズ第2問
- ・【大喜利】【投稿~9/7】 ロボットの住む世界で流行ってる罰ゲームとは?
- ・推しミネラルウォーターはありますか?
- ・都道府県穴埋めゲーム
- ・この人頭いいなと思ったエピソード
- ・準・究極の選択
- ・ゆるやかでぃべーと タイムマシンを破壊すべきか。
- ・歩いた自慢大会
- ・許せない心理テスト
- ・字面がカッコいい英単語
- ・これ何て呼びますか Part2
- ・人生で一番思い出に残ってる靴
- ・ゆるやかでぃべーと すべての高校生はアルバイトをするべきだ。
- ・初めて自分の家と他人の家が違う、と意識した時
- ・単二電池
- ・チョコミントアイス
デイリーランキングこのカテゴリの人気デイリーQ&Aランキング
-
batである文字列内に特定の文字...
-
シェルスクリプトでうるう年判定
-
Bシェル 文字列に含まれる特...
-
【sh】tee コマンドの代替方法
-
bashスクリプト
-
if文について
-
シェルスクリプトの変数の制限?
-
シェルプログラムの判定について
-
sh スクリプト ipアドレス形式...
-
Dirコマンドでフォルダ内ファイ...
-
TOPコマンドで表示するCPU使用...
-
pingは正常なのにtracerouteで...
-
Linux環境 grepで改行コード(CR...
-
エクセルの表にヘンな枠が・・・
-
スクリプトのエラー「unexpecte...
-
ファイル名についている「-」と...
-
ラズパイで『’test.service’をs...
-
UNIX コマンドにおける # や円...
-
Mac de プログラム
-
-bash: ftp: コマンドが見つか...
マンスリーランキングこのカテゴリの人気マンスリーQ&Aランキング
-
batである文字列内に特定の文字...
-
スクリプト中のexportコマンド...
-
kshでのNULLの比較
-
if文について
-
bashスクリプト
-
ファイルから文字列を読み込む...
-
シェルスクリプトの変数の制限?
-
shellスクリプトから別のshell...
-
Bシェル 文字列に含まれる特...
-
【sh】tee コマンドの代替方法
-
cshの条件式について教えてくだ...
-
Cシェルプログラムで、あるディ...
-
load averageが0.50を超えた時...
-
【シェルスクリプト】whileルー...
-
Bashでキーボードから入力は?
-
sedなどで、特定の文字列からタ...
-
Cシェルで標準エラー出力への...
-
rubyで、バッククォートの中に...
-
bashで変数の文字列を編集する...
-
Cシェルで、文字列中(str)に、...
おすすめ情報