
{"id":4178,"date":"2010-10-06T09:19:06","date_gmt":"2010-10-06T03:49:06","guid":{"rendered":"http:\/\/www.jeffrin.in\/?p=3035"},"modified":"2010-10-06T09:19:06","modified_gmt":"2010-10-06T03:49:06","slug":"build-and-execute-command-lines-from-standard-input","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2010\/10\/06\/build-and-execute-command-lines-from-standard-input\/","title":{"rendered":"[x]args build and execute +"},"content":{"rendered":"<p><a href=\"http:\/\/www.jeffrin.in\/wp-content\/uploads\/2010\/10\/xargs.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.jeffrin.in\/wp-content\/uploads\/2010\/10\/xargs-300x225.png\" alt=\"\" title=\"xargs\" width=\"300\" height=\"225\" class=\"aligncenter size-medium wp-image-3049\" \/><\/a><\/p>\n<p class=\"code\">\n<p>$ls robinsons.iso<br \/>\nrobinsons.iso<br \/>\n$ls | grep robinsons.iso | xargs rm<br \/>\n$ls robinsons.iso<br \/>\nls: cannot access robinsons.iso: No such file or directory<br \/>\n$\n<\/p>\n<p class=\"theory\">\nxargs &#8211; build and execute command lines from standard input<br \/>\nThis  manual  page  documents  the  GNU  version of xargs.  xargs reads items<br \/>\nfrom the standard input, delimited by blanks (which can be protected with double or single<br \/>\nquotes or a backslash) or newlines, and executes the command (default is \/bin\/echo)<br \/>\none or more times with any initial-arguments followed by items  read  from  standard<br \/>\ninput.  Blank lines on the standard input are ignored.<br \/>\nBecause  Unix  filenames  can contain blanks and newlines, this default behaviour is often<br \/>\nproblematic; filenames containing blanks and\/or newlines are incorrectly processed by xargs.<br \/>\nIn these situations it is better to use the -0 option, which prevents such problems.<br \/>\nWhen using this option you will need to ensure that the program which produces the input<br \/>\nfor xargs also uses a null character as a separator.  If that program is GNU find for example,<br \/>\nthe -print0 option does this for you.<br \/>\nReference\/Source :<br \/>\nDebian manual page for &#8220;xargs&#8221;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>$ls robinsons.iso robinsons.iso $ls | grep robinsons.iso | xargs rm $ls robinsons.iso ls: cannot access robinsons.iso: No such file or directory $ xargs &#8211; build and execute command lines from standard input This manual page documents the GNU version of xargs. xargs reads items from the standard input, delimited by blanks (which can be protected &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2010\/10\/06\/build-and-execute-command-lines-from-standard-input\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;[x]args build and execute +&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[82],"tags":[939,1361,1482,1716],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/4178"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=4178"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/4178\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=4178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=4178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=4178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}