68

How can I programmatically determine the current Cygwin user's home directory in Windows format (e.g. C:\cygwin\home\user) so I can read from it outside of Cygwin Bash?

bbodenmiller
  • 3,101
  • 5
  • 34
  • 50

1 Answers1

96

You can use cygpath:

cygpath -w ~

Example output:

C:\Users\dhaley
Daniel Haley
  • 51,389
  • 6
  • 69
  • 95