A snippet to get the current user’s default shell: getent passwd $LOGNAME | cut -d: -f7 This is the only method to have extract the default shell setting. Some would suggest to use echo $SHELL. The command only show your current shell. If you open another shell in it, the $SHELL changes accordingly. Read more
As you might have noticed, syscall.Uname sets the variables into a *syscall.Utsname struct with fields in type [65]int. It is not difficult to display the output, but the code is too tiny for a library of any sort. Just share the code snippet here: // UtsnameStr reads [65]int8 into string func UtsnameStr(in []int8) string { i,... Read more
Started a new blog on Github Pages with Jekyll. Will write technical related stuff here. Hope this is not too boring for you. Read more