Récupérer le fichier d'un chemin donné
Résolu/Fermé
bossoax
Messages postés
44
Date d'inscription
mardi 27 novembre 2007
Statut
Membre
Dernière intervention
13 novembre 2012
-
24 juin 2009 à 16:36
dubcek Messages postés 18718 Date d'inscription lundi 15 janvier 2007 Statut Contributeur Dernière intervention 22 mars 2024 - 24 juin 2009 à 17:19
dubcek Messages postés 18718 Date d'inscription lundi 15 janvier 2007 Statut Contributeur Dernière intervention 22 mars 2024 - 24 juin 2009 à 17:19
A voir également:
- Récupérer le fichier d'un chemin donné
- Fichier rar - Guide
- Comment récupérer un compte facebook piraté - Guide
- Fichier host - Guide
- Comment recuperer un message supprimé sur whatsapp - Guide
- Fichier iso - Guide
4 réponses
dubcek
Messages postés
18718
Date d'inscription
lundi 15 janvier 2007
Statut
Contributeur
Dernière intervention
22 mars 2024
5 615
24 juin 2009 à 17:03
24 juin 2009 à 17:03
hello
$ basename /TOM/TOTO/DIR.txt
DIR.txt
$ basename /TOM/TOTO/DIR.txt
DIR.txt
HostOfSeraphim
Messages postés
6750
Date d'inscription
jeudi 2 février 2006
Statut
Contributeur
Dernière intervention
31 juillet 2016
1 607
24 juin 2009 à 16:44
24 juin 2009 à 16:44
Pour /TOM/TOTO/DIR.txt :
echo "/TOM/TOTO/DIR.txt" | awk -F "/" '{ print $4; }'
Par contre, ça ne marchera pas pour /TOM/DIR.txt ou TOM/TITI/TOTO/DIR.txt...
echo "/TOM/TOTO/DIR.txt" | awk -F "/" '{ print $4; }'
Par contre, ça ne marchera pas pour /TOM/DIR.txt ou TOM/TITI/TOTO/DIR.txt...
bossoax
Messages postés
44
Date d'inscription
mardi 27 novembre 2007
Statut
Membre
Dernière intervention
13 novembre 2012
24 juin 2009 à 17:16
24 juin 2009 à 17:16
Merci pour le basename, l'autre est trop complexe mais merci aussi c'est sympa !!!
dubcek
Messages postés
18718
Date d'inscription
lundi 15 janvier 2007
Statut
Contributeur
Dernière intervention
22 mars 2024
5 615
24 juin 2009 à 17:19
24 juin 2009 à 17:19
et en complément de basename, il y a dirname pour récupérer le reste
$ dirname /TOM/TOTO/DIR.txt
/TOM/TOTO
$ dirname /TOM/TOTO/DIR.txt
/TOM/TOTO