[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [HS] qqun peut-il m'aider pour un script bash ??



On jeu, jan 10, 2002 at 05:03:32 +0100, Camille Dominique wrote:
> 2ème essai:
> 	ps x | grep dvif\\b	
> 	
> 	(en partant du fait qu'un tel processus 'dvifb' existe)
> 	
> résultat:  
> 	19298 pts/1    S      0:00 grep dvif\b
> 
> Ça alors! 
> Mais Pourquoi? 
> 'man grep' ;-)

$ man grep
/\\b
symbol \b matches the empty string at the edge of a  word

Donc "grep dvif\\b" cherche un mot finissant par "dvif" et ne trouve pas
dvifb mais bien dvif\b. Mieux vaut utiliser le "grep [d]vifb" pour
éviter les effets de bord du \

Olivier
-- 
All the really good ideas I ever had came to me while I was milking a cow.
		-- Grant Wood



Reply to: