"#"
開始的註解,請再利用管線命令以 sed 刪除註解行。
[dywang@dywmac ~]$ grep MANPATH /etc/man.config # when MANPATH contains an empty substring), to find out where the cat # MANPATH manpath_element [corresponding_catdir] # MANPATH_MAP path_element manpath_element # Every automatically generated MANPATH includes these fields MANPATH /usr/man MANPATH /usr/share/man MANPATH /usr/local/man MANPATH /usr/local/share/man MANPATH /usr/X11R6/man # MANPATH /opt/*/man # MANPATH /usr/lib/*/man # MANPATH /usr/share/*/man # MANPATH /usr/kerberos/man # Set up PATH to MANPATH mapping MANPATH_MAP /bin /usr/share/man MANPATH_MAP /sbin /usr/share/man MANPATH_MAP /usr/bin /usr/share/man MANPATH_MAP /usr/sbin /usr/share/man MANPATH_MAP /usr/local/bin /usr/local/share/man MANPATH_MAP /usr/local/sbin /usr/local/share/man MANPATH_MAP /usr/X11R6/bin /usr/X11R6/man MANPATH_MAP /usr/bin/X11 /usr/X11R6/man MANPATH_MAP /usr/bin/mh /usr/share/man
[dywang@dywmac ~]$ grep MANPATH /etc/man.config | sed '/^#/d' MANPATH /usr/man MANPATH /usr/share/man MANPATH /usr/local/man MANPATH /usr/local/share/man MANPATH /usr/X11R6/man MANPATH_MAP /bin /usr/share/man MANPATH_MAP /sbin /usr/share/man MANPATH_MAP /usr/bin /usr/share/man MANPATH_MAP /usr/sbin /usr/share/man MANPATH_MAP /usr/local/bin /usr/local/share/man MANPATH_MAP /usr/local/sbin /usr/local/share/man MANPATH_MAP /usr/X11R6/bin /usr/X11R6/man MANPATH_MAP /usr/bin/X11 /usr/X11R6/man MANPATH_MAP /usr/bin/mh /usr/share/man
MAN
改成 man
。
[dywang@dywmac ~]$ grep -v '^#' /etc/man.config | sed -e '10,$d' -e 's/MAN/man/g' FHS manPATH /usr/man manPATH /usr/share/man manPATH /usr/local/man manPATH /usr/local/share/man manPATH /usr/X11R6/man manPATH_MAP /bin /usr/share/man manPATH_MAP /sbin /usr/share/man manPATH_MAP /usr/bin /usr/share/man
[dywang@dywmac zzz]$ vim ds.src [dywang@dywmac zzz]$ cat ds.src 10,$d s/MAN/man/g [dywang@dywmac zzz]$ grep -v '^#' /etc/man.config | sed -f ds.src FHS manPATH /usr/man manPATH /usr/share/man manPATH /usr/local/man manPATH /usr/local/share/man manPATH /usr/X11R6/man manPATH_MAP /bin /usr/share/man manPATH_MAP /sbin /usr/share/man manPATH_MAP /usr/bin /usr/share/man