There is a "chsh" file in /etc/bash_completion.d . When I type "./chsh" in the directory /etc/bash_completion.d , nothing happens. Why?

If the "chsh" utility is disabled in Cygwin, are there ways to turn it on? If it's disabled, does it imply that all the utilities in /etc/bash_completion.d are disabled in Cygwin?

Update: It seems that the "chsh" utility isn't in any package of Cygwin. Is that right?

migrated from stackoverflow.com Sep 1 '11 at 6:06

This question came from our site for professional and enthusiast programmers.


The file in /etc/bash_completion.d is a library of command-line completion functions. It is not the chsh command.

  • Oh. Thanks. So the "chsh" command isn't available in Cygwin at all? – alex_wang Aug 31 '11 at 5:48
  • Probably not; it doesn't make much sense in a non-UNIX environment. If it's anywhere, it'll be at /bin/chsh or /usr/bin/chsh. – duskwuff Aug 31 '11 at 5:50
  • Thanks a lot. Then Cygwin only provides bash, right? There's no way to invoke another shell, e.g. tcsh? – alex_wang Aug 31 '11 at 5:55
  • Certainly Cygwin supports shells other than bash. I don't think tcsh is installed by default, but it's easy enough to install it (it's under "shells" when you run setup.exe). I don't remember whether chsh is available. If not, you can run tcsh manually or edit /etc/passwd. – Keith Thompson Aug 31 '11 at 6:22
  • 1
    Yep, Cygwin also offers zsh, mksh (a Korn Shell), and a few more. – ak2 Aug 31 '11 at 8:05

Well answered at http://cygwin.com/ml/cygwin-xfree/2010-02/msg00057.html

You need to edit /etc/passwd (with a text editor), change the last field in the line for your userid to /bin/tcsh


I suspect the reason for chsh not being available is that Cygwin doesn't have the setuid facility for allowing an executable to be run with the rights of its owner. This would be needed to allow chsh to change the shell entry in /etc/passwd when run by a limited user. Administrators can edit /etc/passwd directly anyway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.