Travailler avec un fichier au format unix
Bonjour,
Je dispose dans mon script batch du code suivant:
Code:
1 2 3 4 5 6 7 8 9 10 11
| :check_sum
%sha256deep% -b %pathname%\*.* > %pathname%\%def_h0%
for /f "tokens=1,* delims= " %%a in (%pathname%\%def_h0%) do (
echo SHA256 ^(%%b^) = %%a >> %pathname%\%def_h1%
type %pathname%\%def_h1% | %findstr% -v "(def_h0.tmp)" >> %pathname%\%def_h2%
del %pathname%\%def_h0% %pathname%\%def_h1%
)
echo.
echo =^> Save SHA-256 file: complete.
echo.
goto quit_program |
Celui-ci génère en sortie un fichier SHA256 au format Windows.
Je veux utiliser ce même code afin qu'il génère un fichier au format unix, je rajoute simplement l'option -0 comme l'est spécifié dans la documentation de sha256deep.exe
comme suit (d'ailleurs j'obtiens bien un fichier au format unix):
Code:
1 2 3 4 5 6 7 8 9 10 11
| %sha256deep% -b -0 %pathname%\*.* > %pathname%\%def_h0%
<------- à partir d'ici tout le code qui suit ne fonctionne plus ------->
for /f "tokens=1,* delims= " %%a in (%pathname%\%def_h0%) do (
echo SHA256 ^(%%b^) = %%a >> %pathname%\%def_h1%
type %pathname%\%def_h1% | %findstr% -v "(def_h0.tmp)" >> %pathname%\%def_h2%
del %pathname%\%def_h0% %pathname%\%def_h1%
)
echo.
echo =^> Save SHA-256 file: complete.
echo.
goto quit_program |
Comment se fait-il comme indiqué un peu plus haut que toutes les commandes se trouvant dans la boucle for et la boucle for elle-même ne fonctionne plus ?
Pourriez-vous me donner de plus amples informations s'il vous plaît ?
PS: J'ai même utilisé la commande echo.exe (portée sous windows), ainsi que type.exe (portée sous windows également) mais rien y fait.
Merci :aie: