マッチしたファイル名を取得する - PowerShellマッチしたファイル名を取得するPS> rg -l foo 1.txt 2.txt a\3.txt カンマ区切りのStringで取り出すPS> (rg -l -0 foo) -Replace "\0","," 1.txt,2.txt,a\3.txt, 配列で取り出すPS> $array = (rg -l -0 foo) -Split "\0","," PS> $array[1] 2.txt 参考https://github.com/BurntSushi/ripgrep/blob/master/doc/rg.1.txt.tpl |
|