{"id":5124,"date":"2014-03-30T19:03:20","date_gmt":"2014-03-30T19:03:20","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/problem-about-cut-collection-of-common-programming-errors\/"},"modified":"2014-03-30T19:03:20","modified_gmt":"2014-03-30T19:03:20","slug":"problem-about-cut-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/problem-about-cut-collection-of-common-programming-errors\/","title":{"rendered":"problem about cut-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/30816b3d787c2bd9d6f036318304f225?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\njordanm<br \/>\nlinux bash find cut<br \/>\nI have the following script called oftencleanup.sh#!\/bin\/bash DEFAULT_LIMIT=10 INPUT=$1 PATTERN=$2 LIMIT=$3if [ &#8220;$INPUT&#8221; == &#8220;&#8221; ] || [ &#8220;$PATTERN&#8221; == &#8220;&#8221; ] thenecho &#8220;usage: $0 INPUT PATTERN [LIMIT]&#8221;exit 1; fi if [ &#8220;$LIMIT&#8221; == &#8220;&#8221; ] thenLIMIT=$DEFAULT_LIMIT fifind \/var\/project\/project1 -maxdepth 1 -type d -name &#8220;${INPUT}-${PATTERN}*&#8221; -printf &#8216;%T@ %p\\n&#8217;|sort -nr|tail -n+$LIMIT|cut -f 2- -d &#8221; &#8220;|xargs -i rm -rf {}So this one is supposed to remove the last but $LIMIT directories with prefix $INPUT-$PATTE<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ebc47ee771e1695743e6b79c0821f37f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nKit Sunde<br \/>\ncommand-line cut<br \/>\nI have a file cities like this:[1598] San Diego, US (inactive) [4517] St Louis, US (inactive) [6346] Orlando, US (inactive)I want to cut out the city names, so that I have:San Diego St Louis OrlandoThis is the best I could come up with:cut -d &#8216;,&#8217; -f1 cities | cut -d &#8216;]&#8217; -f2But that still leaves me with a space before the names. Is there a cut like command that I can use that accept delimiters of several characters so I can cut on ]?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3869df153e401f4ca7de53295641dee1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser732274<br \/>\nobjective-c osx paste cut<br \/>\nI&#8217;d like to disable cut and\/or paste in the menubar at runtime, in my ObjC app. I know that that&#8217;s possible in iOS using -(BOOL)canPerformAction:(SEL)aSelector withSender:(id)senderIs there anything similar for MacOS?Thank you<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/WtGLj.png?s=32&amp;g=1\" \/><br \/>\nDave Newman<br \/>\napple final cut compressor<br \/>\nI got this error and any clues will be appreciated.Thanks Process: Compressor [535] Path: \/Applications\/Compressor.app\/Contents\/MacOS\/Compressor Identifier: com.apple.compressor.Compressor Version: ??? (???) Build Info: Compressor-1440000~2 Code Type: PPC (Native) Parent Process: launchd [106]Interval Since Last Report: 1350 sec Crashes Since Last Report: 2 Per-App Interval Since Last Report: 0 sec Per-App Crashes Since Last Report:<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1b67449209a74896204d9453fbea2760?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nptheofan<br \/>\njavascript jquery keyboard-shortcuts cut<br \/>\nI have trapped the cut event (jquery) on a textbox. What I want is to get the text on the textbox during the cut event is triggered.I&#8217;ve tried accessing the data the user cut via evt.originalEvent.clipboardData.getData(&#8216;text&#8217;) but returns undefined.My goal is to know if the user cut all the text (textbox is now empty) or not.Thanks in advance<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>jordanm linux bash find cut I have the following script called oftencleanup.sh#!\/bin\/bash DEFAULT_LIMIT=10 INPUT=$1 PATTERN=$2 LIMIT=$3if [ &#8220;$INPUT&#8221; == &#8220;&#8221; ] || [ &#8220;$PATTERN&#8221; == &#8220;&#8221; ] thenecho &#8220;usage: $0 INPUT PATTERN [LIMIT]&#8221;exit 1; fi if [ &#8220;$LIMIT&#8221; == &#8220;&#8221; ] thenLIMIT=$DEFAULT_LIMIT fifind \/var\/project\/project1 -maxdepth 1 -type d -name &#8220;${INPUT}-${PATTERN}*&#8221; -printf &#8216;%T@ %p\\n&#8217;|sort -nr|tail -n+$LIMIT|cut [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5124","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5124"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5124\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}