Run shell script on windows using Cygwin

elbek

I am having trouble with running .sh script on Windows using Cygwin.

When i run the file: ./build.sh -s srv.txt I am getting: ./build.sh: line 1: #!/bin/bash: No such file or directory

Can you guys help me what does that mean. The 1st line is commented :)

thanks.

Ryan Gates

I had the same issue running cygwin under windows. For me, it had nothing to do with the path.

It had everything to do with the encoding. I was using UTF-8 with the BOM (Byte Order Mark). The BOM was causing it to choke. Once I removed it, it worked flawlessly.

I updated the encoding using Notepad++ by:

Encoding -> Encode in UTF-8 without BOM

The which bash command outputted:

/usr/bin/bash

However it was still able to resolve

#!/bin/bash

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How to run Bash shell script on Windows?

분류에서Dev

Run Android Studio on reboot using shell script

분류에서Dev

How do I run a windows executable in linux shell script?

분류에서Dev

Installiing XV on windows using cygwin

분류에서Dev

Run script in a non interactive shell?

분류에서Dev

Shell script does not run properly

분류에서Dev

How to run a shell script in background?

분류에서Dev

How do I run bash shell scripts in cygwin?

분류에서Dev

Using find in shell script

분류에서Dev

cygwin에서 왜 이것이 필요합니까?-export SHELLOPTS set -o igncr to run my shell script?

분류에서Dev

Compiling ffmpeg for windows with WebM libraries using Cygwin

분류에서Dev

Using mintty as default terminal on Cygwin and default shell as bash

분류에서Dev

how to run a shell script on git commit

분류에서Dev

How to schedule run shell script that opens Firefox

분류에서Dev

executing shell command using shell script

분류에서Dev

Text to speech using shell script

분류에서Dev

Shell script: run screen, open several screens and run a command in each

분류에서Dev

Cygwin - cd in bash script

분류에서Dev

Windows 7 - How to run a script at shutdown but not at logoff

분류에서Dev

Run a powershell script inside a windows service

분류에서Dev

Windows batch script should run at some interval

분류에서Dev

Live output of shell script using `watch` in browser?

분류에서Dev

Create new files in Shell script using VIM

분류에서Dev

Running shell script using PHP over http

분류에서Dev

running shell script using c program

분류에서Dev

Can a shell script running in a ssh continue to run if the SSH instance closes?

분류에서Dev

Getting error ": command not found" when trying to run shell script

분류에서Dev

How do run MYSQL scripts from a shell script with bash variables?

분류에서Dev

Shell script to run Linux command on multiple servers command by command

Related 관련 기사

  1. 1

    How to run Bash shell script on Windows?

  2. 2

    Run Android Studio on reboot using shell script

  3. 3

    How do I run a windows executable in linux shell script?

  4. 4

    Installiing XV on windows using cygwin

  5. 5

    Run script in a non interactive shell?

  6. 6

    Shell script does not run properly

  7. 7

    How to run a shell script in background?

  8. 8

    How do I run bash shell scripts in cygwin?

  9. 9

    Using find in shell script

  10. 10

    cygwin에서 왜 이것이 필요합니까?-export SHELLOPTS set -o igncr to run my shell script?

  11. 11

    Compiling ffmpeg for windows with WebM libraries using Cygwin

  12. 12

    Using mintty as default terminal on Cygwin and default shell as bash

  13. 13

    how to run a shell script on git commit

  14. 14

    How to schedule run shell script that opens Firefox

  15. 15

    executing shell command using shell script

  16. 16

    Text to speech using shell script

  17. 17

    Shell script: run screen, open several screens and run a command in each

  18. 18

    Cygwin - cd in bash script

  19. 19

    Windows 7 - How to run a script at shutdown but not at logoff

  20. 20

    Run a powershell script inside a windows service

  21. 21

    Windows batch script should run at some interval

  22. 22

    Live output of shell script using `watch` in browser?

  23. 23

    Create new files in Shell script using VIM

  24. 24

    Running shell script using PHP over http

  25. 25

    running shell script using c program

  26. 26

    Can a shell script running in a ssh continue to run if the SSH instance closes?

  27. 27

    Getting error ": command not found" when trying to run shell script

  28. 28

    How do run MYSQL scripts from a shell script with bash variables?

  29. 29

    Shell script to run Linux command on multiple servers command by command

뜨겁다태그

보관