Remplacer retour ligne par <br/> find
Utilisateur anonyme
-
Utilisateur anonyme -
Utilisateur anonyme -
Bonjour,
Je fais la commande suivante:
find /share/EPSI/ -type f -mtime -1 | tr '\r' '<br/>' >> /home/scripts/tempMail.txt
Ca ne fonctionne pas car je souhaite lister les fichiers dans un fichier et remplacer le retour chariot entre chaque fichier par un <br/> html.
Comment faire?
Je fais la commande suivante:
find /share/EPSI/ -type f -mtime -1 | tr '\r' '<br/>' >> /home/scripts/tempMail.txt
Ca ne fonctionne pas car je souhaite lister les fichiers dans un fichier et remplacer le retour chariot entre chaque fichier par un <br/> html.
Comment faire?
A voir également:
- Retour chariot linux
- Linux reader - Télécharger - Stockage
- Retour à la ligne excel formule - Guide
- Toutou linux - Télécharger - Systèmes d'exploitation
- Retour chariot notepad++ - Forum Google Docs
- Backtrack linux - Télécharger - Sécurité
5 réponses
salut,
il n'y a pas de retour chariot (\r, ^M) sur UNIX/Linux, seulement une nouvelle ligne (\n, ^J).
il n'y a pas de retour chariot (\r, ^M) sur UNIX/Linux, seulement une nouvelle ligne (\n, ^J).
Cette ligne sera dans un script automatisé par crobtab alors je vais pas l'amusé a le faire avec notepad.
J'ai essayé: find /share/EPSI/ -type f -mtime -1 | tr '\n' '<br/>' >> /home/scripts/tempMail.txt
Mais ne fonctionne toujours pas
J'ai essayé: find /share/EPSI/ -type f -mtime -1 | tr '\n' '<br/>' >> /home/scripts/tempMail.txt
Mais ne fonctionne toujours pas
Salut,
find /share/EPSI/ -type f -mtime -1 -print0 | sed 's#\x00#<br/>#g' >> /home/scripts/tempMail.txt
find /share/EPSI/ -type f -mtime -1 | tr '\n' '<br/>' >> /home/scripts/tempMail.txt ne fonctionne pas comme il devrait, je récupère:
/share/EPSI/Gestion de projet/Projet de groupe/test2.txt</share/EPSI/Gestion de projet/Projet de groupe/test.txt<
alors que je devrais avoir :
/share/EPSI/Gestion de projet/Projet de groupe/test2.txt<br/>/share/EPSI/Gestion de projet/Projet de groupe/test.txt<br/>
/share/EPSI/Gestion de projet/Projet de groupe/test2.txt</share/EPSI/Gestion de projet/Projet de groupe/test.txt<
alors que je devrais avoir :
/share/EPSI/Gestion de projet/Projet de groupe/test2.txt<br/>/share/EPSI/Gestion de projet/Projet de groupe/test.txt<br/>
Ca ne fonctionne pas, j'ai l'erreur:
Usage: find [PATH...] [EXPRESSION]
Search for files in a directory hierarchy. The default PATH is
the current directory; default EXPRESSION is '-print'
EXPRESSION may consist of:
-follow Dereference symbolic links.
-name PATTERN File name (leading directories removed) matches PATTERN.
-print Print (default and assumed).
-type X Filetype matches X (where X is one of: f,d,l,b,c,...)
-perm PERMS Permissions match any of (+NNN); all of (-NNN);
or exactly (NNN)
-mtime TIME Modified time is greater than (+N); less than (-N);
or exactly (N) days
Usage: find [PATH...] [EXPRESSION]
Search for files in a directory hierarchy. The default PATH is
the current directory; default EXPRESSION is '-print'
EXPRESSION may consist of:
-follow Dereference symbolic links.
-name PATTERN File name (leading directories removed) matches PATTERN.
-print Print (default and assumed).
-type X Filetype matches X (where X is one of: f,d,l,b,c,...)
-perm PERMS Permissions match any of (+NNN); all of (-NNN);
or exactly (NNN)
-mtime TIME Modified time is greater than (+N); less than (-N);
or exactly (N) days
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question