{"id":1320,"date":"2024-09-03T13:45:36","date_gmt":"2024-09-03T18:45:36","guid":{"rendered":"https:\/\/ma.rcbla.se\/blog\/?p=1320"},"modified":"2025-02-13T12:31:16","modified_gmt":"2025-02-13T18:31:16","slug":"converting-windows-line-endings-to-unix","status":"publish","type":"post","link":"https:\/\/ma.rcbla.se\/blog\/2024\/09\/converting-windows-line-endings-to-unix\/","title":{"rendered":"Converting Windows line endings to UNIX"},"content":{"rendered":"<p>Especially in the case of writing shell scripts. It&#8217;s imperative to move from CRLF (Win) to LF (*nix) so they will run.<\/p>\n<p>Try this:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ dos2unix FILE_NAME.EXT<\/pre>\n<p>if that doesn&#8217;t work, then try this.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ sed -i 's\/\\r$\/\/' FILE_NAME.EXT<\/pre>\n<p>Also, make sure you&#8217;ve set the permission bits so they can execute.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ chmod 770 FILE_NAME.EXT<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Especially in the case of writing shell scripts. It&#8217;s imperative to move from CRLF (Win) to LF (*nix) so they will run. Try this: $ dos2unix FILE_NAME.EXT if that doesn&#8217;t work, then try this. $ sed -i &#8216;s\/\\r$\/\/&#8217; FILE_NAME.EXT Also, make sure you&#8217;ve set the permission bits so they can execute. $ chmod 770 FILE_NAME.EXT<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51,11,65],"tags":[],"class_list":["post-1320","post","type-post","status-publish","format-standard","hentry","category-cli","category-coding","category-sysadmin"],"_links":{"self":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/1320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/comments?post=1320"}],"version-history":[{"count":4,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/1320\/revisions"}],"predecessor-version":[{"id":1386,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/1320\/revisions\/1386"}],"wp:attachment":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/media?parent=1320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/categories?post=1320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/tags?post=1320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}