メインコンテンツへスキップ

findした結果をxargsで展開できない

· loading · loading ·
kiitosu
著者
kiitosu
画像処理やデバイスドライバ、データ基盤構築からWebバックエンドまで、多様な領域に携わってきました。地図解析や地図アプリケーションの仕組みにも経験があり、幅広い技術を活かした開発に取り組んでいます。休日は草野球とランニングを楽しんでいます。

fineした結果をループ処理しようとしたら一部replstrが展開されず。

なんでかなぁと思ったら xargsが255byteまでしか展開できない | ottijp blog

ということらしく

Macのxargsの-Iオプションに潜む罠 - Qiita

複数の場合は合算されるらしい。

macだけの仕様らしい。

man xargsから抜粋。

     -I replstr
             Execute utility for each input line, replacing one or more
             occurrences of replstr in up to replacements (or 5 if no -R flag
             is specified) arguments to utility with the entire line of input.
             The resulting arguments, after replacement is done, will not be
             allowed to grow beyond replsize (or 255 if no -S flag is
             specified) bytes; this is implemented by concatenating as much of
             the argument containing replstr as possible, to the constructed
             arguments to utility, up to replsize bytes.  The size limit does
             not apply to arguments to utility which do not contain replstr,
             and furthermore, no replacement will be done on utility itself.
             Implies -x.
Reply by Email

関連記事

GithubからのAWS利用時のサムプリントはもはや不要
· loading · loading
hasura nested mutatoin
· loading · loading
ORDER BY は 列毎に指定できる
· loading · loading