{"id":59,"date":"2009-07-06T23:33:05","date_gmt":"2009-07-06T22:33:05","guid":{"rendered":"http:\/\/fapg.nsk.pt\/?p=59"},"modified":"2009-07-30T16:23:45","modified_gmt":"2009-07-30T15:23:45","slug":"convert-a-string-to-upper-or-lower-case-in-bash","status":"publish","type":"post","link":"https:\/\/fapg.nsk.pt\/en\/2009\/07\/convert-a-string-to-upper-or-lower-case-in-bash\/","title":{"rendered":"Convert a string to upper or lower case in bash"},"content":{"rendered":"<p>If you want change a string to lower, do this:<\/p>\n<p><!--more--><\/p>\n<p>echo XpTo | tr &#8220;[:upper:]&#8221; &#8220;[:lower:]&#8221;<\/p>\n<p>for all files in a directory you can do with the for command:<\/p>\n<p>for i in * ; do cp $i ..\/wordpress_gallery\/`echo $i | tr &#8220;[:upper:]&#8221; &#8220;[:lower:]&#8221;` ; done<\/p>\n<p>To upper, you only need to change the parameters order:<\/p>\n<p>echo XpTo | tr &#8220;[:lower:]&#8221; &#8220;[:upper:]&#8221; <\/p>","protected":false},"excerpt":{"rendered":"<p>If you want change a string to lower, do this:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[16,5],"tags":[21],"class_list":["post-59","post","type-post","status-publish","format-standard","hentry","category-command-line","category-linux","tag-bash"],"_links":{"self":[{"href":"https:\/\/fapg.nsk.pt\/en\/wp-json\/wp\/v2\/posts\/59","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fapg.nsk.pt\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fapg.nsk.pt\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fapg.nsk.pt\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fapg.nsk.pt\/en\/wp-json\/wp\/v2\/comments?post=59"}],"version-history":[{"count":4,"href":"https:\/\/fapg.nsk.pt\/en\/wp-json\/wp\/v2\/posts\/59\/revisions"}],"predecessor-version":[{"id":71,"href":"https:\/\/fapg.nsk.pt\/en\/wp-json\/wp\/v2\/posts\/59\/revisions\/71"}],"wp:attachment":[{"href":"https:\/\/fapg.nsk.pt\/en\/wp-json\/wp\/v2\/media?parent=59"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fapg.nsk.pt\/en\/wp-json\/wp\/v2\/categories?post=59"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fapg.nsk.pt\/en\/wp-json\/wp\/v2\/tags?post=59"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}