{"id":232,"date":"2009-04-06T01:43:50","date_gmt":"2009-04-06T06:43:50","guid":{"rendered":"http:\/\/yourlinuxguy.com\/?p=232"},"modified":"2009-04-06T07:37:42","modified_gmt":"2009-04-06T12:37:42","slug":"what-ever-happened-to-unix2dos-in-sles","status":"publish","type":"post","link":"https:\/\/yourLinuxGuy.com\/?p=232","title":{"rendered":"What ever happened to unix2dos in SLES?"},"content":{"rendered":"<p>Why did they take <code>unix2dos<\/code> away from the SLES distribution and all standard (read: supported) repositories?\u00a0 Honestly, I don&#8217;t know.\u00a0 I use it all the time.\u00a0 I&#8217;m pretty sure it used to be included in SLES, and it&#8217;s still in Opensuse and other distros.\u00a0 Ironically, the complementary <code>dos2unix<\/code> is available in SLES as needed.\u00a0 Hmm&#8230;<\/p>\n<p>I&#8217;m guessing that someone high up in Suse\/Novell &#8212; with far more wisdom than me &#8212; decided that we needed a slightly harder-to-memorize method of day-to-day conversion of our unix files to dos than typing &#8220;<code>unix2dos<\/code>&#8220;.\u00a0 So, they made sure that we have access to the more powerful and more complex &#8220;<code>recode<\/code>&#8221; tool (which was already there anyway).\u00a0 So there.<\/p>\n<p>So to cut to the chase, instead of typing:<\/p>\n<p><code>unix2dos file.txt<\/code><\/p>\n<p>&#8230;like you used to, you now get to type:<\/p>\n<p><code>recode latin1..dos file.txt<\/code><\/p>\n<p>&#8230;now let me explain. What we are doing is recoding the file from type <code>ISO-8859-1<\/code>, a.k.a. &#8220;<code>Latin1<\/code>&#8220;, to type <code>IBM-PC<\/code>, a.k.a. &#8220;<code>dos<\/code>&#8220;.\u00a0 As you may have figured out by now,\u00a0 <code>ISO-8859-1\/Latin<\/code>1 is the standard for most unix type systems.\u00a0 Note the two dots in between; this is the required format.\u00a0 To quote from the man page, &#8220;like BEFORE..AFTER, with BEFORE and AFTER being charsets&#8221;.<\/p>\n<p>By the way, instead of typing &#8220;<code>latin1<\/code>&#8220;, you could have used any of the following aliases and types that the recode utility allows:<\/p>\n<p><code>ISO-8859-1 819\/CR-LF CP819\/CR-LF csISOLatin1 IBM819\/CR-LF ISO8859-1 iso-ir-100 ISO_8859-1 ISO_8859-1:1987 l1 lat1 latin1 Latin-1<\/code><\/p>\n<p>And, instead of typing &#8220;<code>dos<\/code>&#8220;, you could have entered any of the following:<\/p>\n<p><code>IBM-PC\/CR-LF dos\/CR-LF MSDOS\/CR-LF pc\/CR-LF<\/code><\/p>\n<p>So there you are.\u00a0 You can use this tool to convert to and from almost any type. Make sure you run <code>recode -l<\/code> to list all the types that can be recoded.  And if you&#8217;re like me, you&#8217;re pretty glad that you still have this cabability&#8230; because you have scripts that export results to file on an NCP mounted volume for parsing by users with Windows and Client32, and you need to convert them to <code>dos<\/code> format so the users can view them in good ol&#8217; Notepad.\u00a0 No?\u00a0 You&#8217;re not like me?<\/p>\n<p>\ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Why did they take unix2dos away from the SLES distribution and all standard (read: supported) repositories?\u00a0 Honestly, I don&#8217;t know.\u00a0 I use it all the time.\u00a0 I&#8217;m pretty sure it used to be included in SLES, and it&#8217;s still in&#8230;<br \/><a class=\"read-more-button\" href=\"https:\/\/yourLinuxGuy.com\/?p=232\">Read more<\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[11,64,15,63],"tags":[],"class_list":["post-232","post","type-post","status-publish","format-standard","hentry","category-intermediate","category-recode","category-suse","category-unix2dos"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pnjn1-3K","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=232"}],"version-history":[{"count":10,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/232\/revisions"}],"predecessor-version":[{"id":241,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/232\/revisions\/241"}],"wp:attachment":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}