[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [NOVICE] slette [] med sed ??



Peter Seidler wrote:
> Man skulle så tro, du kunne skrive:
> sed s/\[TEST\]// minfil.log
> sed s/\\[TEST]// minfil.log

Spørgsmålet er om sed modtager input, eller om bash/tcsh fortolker
input og sender det vidre til sed. Bash vil fortolke \\ som \ så
sed modtager s/\[TEST]//

sed 's/\[TEST\]//' betyder at shell skal køre sed med '..' 
som argument men uden at pille i hvad der står inden i '..'.

Analogt hvad er forskellen mellem:
echo  *
echo '*'
echo "*"

Din shell vil substituere * med alle filer i kataloget. Men kun
i det første eksempel. (Jeg kan ikke huske hvad der sker i det
tredie eksempel).

Du kan også prøve

echo ´ls -la´
og
echo `ls -la`

bemærk at det er apostrof den ene og den anden vej. Det er shell der
styre fortolkningen af argumenter. ´..´ betyder en streng mens `..`
betyre output fra programmet der køres mellem `..`.

-- 
     __  ____    ___           __           sslug@sslug
 __ / / / __/   / _ )___ _____/ /      24h Maraton på DR2 fra 28/7 kl 7 
/ // / _\ \_   / _  / _ `/ __/ _ \     Værker: Brandenburg koncerterne
\___(_)___(_) /____/\_,_/\__/_//_/          h-mol messen og andet.




 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:59 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *