Unix2dos et dos2unix
Apparence
Les commandes dos2unix et unix2dos
Le format des fichiers texte sur MS-DOS et sur Unix est légèrement différent. La commande unix2dos converti un fichier Unix dans le format MS-DOS tandis que dos2unix converti un fichier MS-DOS en format Unix.
Premier exemple
mcopy a:guide.tex . dos2unix guide.tex guide.tex
Ici la première commande copie le fichier MS-DOS guide.tex sur Unix et la commande unix2dos convertit le fichier MS-DOS guide.tex dans le format Unix. Le fichier converti portera également le nom de guide.tex écrasant le fichier original.
Second exemple
Vous voulez sur un CPD linux modifier directement un script de connexion
pico -w /home/e-smith/files/samba/netlogon/netlogon.bat REM To set the time when clients logon to the domain: net time \\servername /set /yes REM To map a home directory to drive h: net use h: /home /persistent:no net use j: \\servername\ibay1 /persistent:no net use p: \\servername\ibay2 /persistent:no if exist Z: net use Z: /del /yes ensuite transformation du fichier dans le format dos
unix2dos /home/e-smith/files/samba/netlogon/netlogon.bat
Tapez man unix2dos ou man dos2unix pour obtenir à l'écran la description détaillée de ces deux commandes.