fixnames.pl
来自「无线通信的主要编程软件,是无线通信工作人员的必备工具,关天相关教程我会在后续传上」· PL 代码 · 共 30 行
PL
30 行
#!/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 + =
减小字号Ctrl + -
显示快捷键?