0

I am very new to cygwin64 and bash. We currently run mkpasswd in cygwin64 manually but i'd like to do it as a windows batch job or via powershell.

To do this I run the command line below

C:\cygwin64\bin\bash --login -i "f:\temp\script.bsh"

The contents of script.bsh are

    mkpasswd -d -cl > "/home/ouradmin/users"

It all works fine except the file that is created is not called users. It's actually users. It puts this weird unicode character at the end.

Can anyone please tell me how to eliminate this.

Simon Darlow
  • 530
  • 5
  • 14
  • Save your script as a UNIX text file, not a DOS text file. Your character almost certainly isn't actually unicode, but just a `$'\r'` -- a CR, aka a carriage return. This is because DOS text files end in CRLF, whereas UNIX text files end only in LF, so when a UNIX process reads a DOS text file, it sees an extra CR at the end. – Charles Duffy Mar 09 '17 at 22:35
  • That did the trick. – Simon Darlow Mar 09 '17 at 22:44

0 Answers0