0

I'm a Windows sysadmin trying to setup a Cygwin in a Windows 2016 environment. Not a Linux or developer person, but I'm open to learn.

I'm able to install Cygwin (x86/64) and most of the commands work just fine. But there is 2 commands that doesn't work: HEAD (10 first lines) and WC (word count). TAIL, CAT CLEAR, PWD are commands that work just fine. HEAD & WC doesn't show anything. An user needs those commands to be working because he's working with huge files.

I've tried Cygwin on my laptop and each command work just fine, Including HEAD & CAT.

Troubleshooting already tried:

1) Run as administrator 2) x86/x64 version = same issues 3) I've already set the PATH environment variable to F:\cygwin64

Troubleshooting that I need help in order to do it:

1) PATH: Do I need to specify the PATH of the Cygwin software to Windows OS on any other way/setting? Do I need to specify the PATH for cygwin in any cygwin config file?

2) I've tried/set the following in my Cygwin desktop shortcut "C:\cygwin64\bin\mintty /bin/bash -l" but the shell just shows for a couple of seconds then it closes.

3) Anything else where I can proceed?

Thanks a lot in advance

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
  • what is the output of `strace /usr/bin/head` ? It should should show up a message box reporting a dll problem – matzeri Jun 04 '18 at 17:50
  • A message box popups saying: "The application was unable to start correctly (0xc0000022). Click OK to close the application" After that , bash states: --- Process 10584 created --- Process 10584 loaded (unknown) at 00007ffa699d0000 --- Process 10584 loaded (unknown) at 00007ffa682c0000 --- Process 10584 loaded (unknown) at 00007ffa669f0000 --- Process 10584 thread 17352 created --- Process 10584 thread 4224 created --- Process 10584 thread 6012 exited with status 0xc0000022 --- Process 10584 thread 4224 exited with status 0xc0000022 --- Process 10584 exited with status 0xc0000022 – Matias Herrera Jun 04 '18 at 17:55

1 Answers1

0

Head and tail belong to the same coreutils package and require the same shared libs.

$ cygcheck -f /usr/bin/tail
coreutils-8.26-2

$ cygcheck -f /usr/bin/head
coreutils-8.26-2

$ cygcheck head
Found: E:\cygwin64\bin\head.exe
E:\cygwin64\bin\head.exe
  E:\cygwin64\bin\cygwin1.dll
    C:\Windows\system32\KERNEL32.dll
      C:\Windows\system32\API-MS-Win-Core-RtlSupport-L1-1-0.dll
      ....
  E:\cygwin64\bin\cygintl-8.dll
    E:\cygwin64\bin\cygiconv-2.dll

$ cygcheck tail 
Found: E:\cygwin64\bin\tail.exe
E:\cygwin64\bin\tail.exe
  E:\cygwin64\bin\cygwin1.dll
    C:\Windows\system32\KERNEL32.dll
      C:\Windows\system32\API-MS-Win-Core-RtlSupport-L1-1-0.dll
      ...
  E:\cygwin64\bin\cygintl-8.dll
    E:\cygwin64\bin\cygiconv-2.dll

If one works and the other not there are 2 possible issues:
. you have screw up the installation
. something is interfering with cygwin

You should follow https://cygwin.com/problems.html and provide the cygcheck.out to the cygwin mailing list, that is more indicated that here for trobleshooting installation problem.

PS:
. the binaries in Cygwin are under "C:\cygwin64\bin"
. you can call mintty with just "-" to invoke a login shell
. You are reporting both C: and F: as disks where the installation resides

matzeri
  • 8,062
  • 2
  • 15
  • 16
  • Thanks a lot matzeri. Will try your indication. And yes, I'm reporting both C: & F: because I've installed both 32 & 64 bits on the Windows server because 64 bits have the HEAD & WC commands issue. This is the content of the Cygwin.bat file : @echo off F: chdir F:\tools\cygwin64\bin bash --login -i I have the same result of executing the command HEAD or WC, if I run cygwin from the exe file or from the bat file. How can I use the login option "-" ? Below is what I've tried it on the shortcut but doesn't work: "F:\tools\cygwin64\bin\mintty.exe -" – Matias Herrera Jun 05 '18 at 15:02