allprofs.sh
来自「Shall高级编程」· Shell 代码 · 共 20 行
SH
20 行
#!/bin/bash# allprofs.sh: print all user profiles# This script written by Heiner Steven, and modified by the document author.FILE=.bashrc # File containing user profile, #+ was ".profile" in original script.for home in `awk -F: '{print $6}' /etc/passwd`do [ -d "$home" ] || continue # If no home directory, go to next. [ -r "$home" ] || continue # If not readable, go to next. (cd $home; [ -e $FILE ] && less $FILE)done# When script terminates, there is no need to 'cd' back to original directory,#+ because 'cd $home' takes place in a subshell.exit 0
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?