I have installed Cygwin on my machine and I would to know if there exist a way to use full power of sort command also with the normal DOS prompt.
I have read this question: Unix Sort with Tab Delimiter and the command to sort a tabbed file using the second column is:
sort -t $'\t' -k 2 file.txt
If I launch the command inside the Cygwin environment it works like expected, if I launch it from the normal Windows prompt (I have renamed sort.exe into xsort.exe to avoid conflicting with native Windows sort command) it doesn't works, it not recognize the $ operator and it see \t like two distinct characters and operation fails.
Is it possible to make it working also from the DOS prompt?
This is regulated by PATH environment variable.
Under DOS prompt run the following:
echo %PATH%
You will see the path C:\cygwin\bin after c:\Windows\system32.
This means that Windows's sort.exe will be used for command sort.
You will need to edit environment variable PATH for your Windows to move c:\cygwin\bin to the left of C:\Windows\system32.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With