简体   繁体   中英

How to launch a shell script make with Linux on Windows

I have a shell script make with Linux with this code:

 #!/bin/sh

    awk '{ print $3,$2,$4,$1}' df_real_credit_network_B0.00_BC0.00_l33.33_day1 > credit_adj
    awk '{ print $3,$2,$5,$1}' df_real_interbank_network_B0.00_BC0.00_l33.33_day1 > interbank_adj

The script creates two objects: "credit_adj" and "interbank_adj", necessary for others scripts for the software R . Obliviously Windows don't recognize the script, so I try to modify the extension ".sh" with ".bat" and I deleted the string "#!/bin/sh" from the script. In this way the two objects are created but are empty, because windows don't recognize the instruction awk . How can I create the two objects correctly?

Thanks

您不能在Windows中直接运行Unix Shell脚本,在Windows中运行Unix / Linux Shell脚本的一种方法是在Windows中安装cygwin并在cygwin中运行脚本

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM