Get list of Linux users with shell access

To get list of Linux users with shell access (/bin/sh, /bin/bash) the following command can be used:

# cat /etc/passwd |egrep "/bin/.*sh" |cut -f1 -d':' |sort