EOL: Ungashandure sei faira reDOS-runyorwa kuenda kuUNIX uye zvinopesana

Sarudza DOS, Unix mameseji edhita menyu

With ichi nyore Tutorial, isu tinogadzirisa diki mishap iyo zvechokwadi ichave yakaitika kwauri. Nguva zhinji zvichave zvakaitika kwatiri kuti kana tichivhura .txt faira muLinux kana Windows, iwo mavara anochinjwa kubva pamafambiro atakamboaita pakutanga. Izvo zvinoitika ndezvekuti mitsara yabatana nesu uye nzvimbo hadzionekwe. Izvi zvinodaro nekuti iyo UNIX mhando zvinyorwa faira fomati inosiyana neyeDOS mhando maererano nehunhu hwe magumo-e-mutsetse (EOL) yavanoshandisa.

Kune UNIX masystem, hunhu i "line feed / newline" kana LF uye zvinoenderana \ n, kana iwe ukaronga zvinonzwika kwauri. Ndichiri muWindows sisitimu inoshandiswa muDOS yekare inogarwa nhaka, ndiko kuti, "kudzoka kwengoro" ichiteverwa ne "line feed / newline" (\ r \ n). Kana, semuenzaniso, takagadziridza iyo faira muLinux uye tiri kuvhura neWindows (uye fomati yatakachengeta haina kukodzera), ipapo pachave nedambudziko rekufara rekuita kuti zvinyorwa zvese zvinyorwe pasina nzvimbo kana mutsara unotyoka.

MuLinux zviri nyore kushandura kubva pane imwe fomati kuenda pane imwe pasina kuisa chero chinhu pane yedu system, ingoshandisa mirairo iyi:

  • Kubva kuDOS kuenda kuUNIX:

Tichashandisa rairo tr, Inoteverwa ne -d paramende uye yakakodzera EOL hunhu. Tichashandisawo "mapaipi" ane mukurumbira kushanda pamwe neDOS zvinyorwa faira ("filename") uye iyo yatinoda kuburitsa yakashandurwa kuita UNIX fomati ("filename"). Ehezve isu tinofanirwa kutanga tashandisa iyo cd yekuraira kuti uende kune iro dhairekitori iro faira kuti rishandurwe kana kubva ku graphical interface pfuudza iyo faira kuenda ku / Kumba (nekutadza iko iko iko kukasira kuri iko):

tr -d '\n' < nombre_archivo > nombre_fichero</p>
  • Kubva paUNIX kusvika kune vaviri:

Iye zvino toshandisa rairo sed kushandura faira reUnix kuita Rudzi rweDOS. Kune izvi isu tinoshandisa inotevera syntax, kutsiva zita remafaira kuti iyo faira ishandurwe. Ini ndoda kujekesa, pese pandinonyora faira ndinoreva Unix mhando uye pandinoisa faira kuWindows / DOS mhando.

sed 's/$/\r/' nombre_fichero > nombre_archivo</p>

Kunyange zvakadaro, mune vanyori vemazuva ano vanyori, inototipa sarudzo ye "Sevha se”Mune fomati yatinoda tisingatombofanira kuzviita kubva kuchipatara. Asi zvinogara zvakanaka kuti uzive zvakawanda nezve iyo Linux command line. Imwe sarudzo ndeyekushandisa maturusi maviri akagadzirirwa chinangwa ichi, dos2unix uye unix2dos, asi mune zvakawanda zvinogoverwa hazvina kuiswa nekutadza uye zvinofanirwa kuiswa


Izvo zviri muchinyorwa zvinoomerera pamisimboti yedu ye tsika dzekunyora. Kuti utaure chikanganiso tinya pano.

Mhinduro, siya zvako

Siya yako yekutaura

Your kero e havazobvumirwi ichibudiswa. Raida minda anozivikanwa ne *

*

*

  1. Inotarisira data: AB Internet Networks 2008 SL
  2. Chinangwa cheiyo data: Kudzora SPAM, manejimendi manejimendi.
  3. Legitimation: Kubvuma kwako
  4. Kutaurirana kwedata
  5. Dhata yekuchengetedza: Dhatabhesi inobatwa neOccentus Networks (EU)
  6. Kodzero: Panguva ipi neipi iwe unogona kudzora, kupora uye kudzima ruzivo rwako

  1.   blahblah1233445 akadaro

    Chirevo chakarurama ndeche
    tr -d 'r' zita rezita