- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
open (FILE, "< /etc/info_file");
while (<FILE>) {
$found++ if (/^\/usr\s+/);
}
close FILE;
if ($found) {
print "# Found /usr entry in /etc/info_file\n" if ($do_debug);
} else {
print "# Adding /home entry to /etc/info_file\n" if ($do_debug);
open (FILE, ">> /etc/auto_master");
print FILE "/usr auto_usr -noview";
close FILE;
}
Но все равно слишком вербоз Это же перл!
У мое решение куда попсовее