📄 fixnames.pl
字号:
#!/usr/bin/perl -w# Script to fix files... the automounter makes it nigh impossible to# get canonical absolute pathnames, so we'll just strip out everything# up to $USERNAME.# Input lines of the format:# number\tpath:number# Output, same, except that the paths inside the home directory will# all be of the form ~/blah/blahuse Cwd 'realpath';$me = `whoami`;chomp($me);while(<>) { chomp(); /^(\d+)\t([^:]*):(\d+)$/; ($bb, $file, $line) = ($1, $2, $3); if(/^\d+\t:-1/) { print "$_\n"; next; } $path = realpath($file) || die "fixname.pl: realpath '$file' failed: $!\n"; $path =~ s|/.*$me/|~/|; # replace "/blah/blah/blah/username" with "~/" print "$bb\t$path:$line\n";}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -