Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
3541 connectés 

  FORUM HardWare.fr
  Programmation
  C

  Argv et tabulation

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Argv et tabulation

n°2276030
bill g@te
Posté le 22-02-2016 à 16:17:18  profilanswer
 

Bonjour,
 
Je n'arrive pas à faire une tabulation dans le shell qui ne dois pas être interpréter comme le tab de l'auto-complétion.
 
./my_prof "abcdefg \t hijkl"
 
Comment vous y prenez-vous ?
 
Merci.

mood
Publicité
Posté le 22-02-2016 à 16:17:18  profilanswer
 

n°2276075
masklinn
í dag viðrar vel til loftárása
Posté le 23-02-2016 à 13:16:16  profilanswer
 

  • ANSI-quoted string: dans une chaîne entre $' et ', les caractères d'échappement ANSI C (genre \t) sont interprétés
  • "verbatim insert", selon le shell Control-V va insérer la touche suivante litéralement au lieu de l'interpréter.
  • printf %b


Donc

> ./my-prof $'foo\tbar'
Got 2 arguments
  ./my-prof
  foo bar


ou bien (foo [Control-V][Tab] bar)


> ./my-prof 'foo      bar'
Got 2 arguments
  ./my-prof
  foo bar


ou encore

> ./my-prof "$(printf %b 'foo\tbar')"
Got 2 arguments
  ./my-prof
  foo bar


Message édité par masklinn le 23-02-2016 à 13:18:42

---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing?

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  C

  Argv et tabulation

 

Sujets relatifs
Hein? mon prog a enlevé une lettre de argv[] [NOVICE]lire une suite de nombre séparé par une tabulation dans un fichier
Positionnement par tabulation après pointage par <a> avec id dans ie8Probléme argv
[SHELL] Comment faire une tabulation dans un echo[BATCH] Comment insérer une tabulation dans un fichier
$_SERVER['argv'] n'existe pas...[DOS] : commande tabulation ou une astuce
Tabulation dans un Jtree -> Marche pas! 
Plus de sujets relatifs à : Argv et tabulation


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)