Unix Shell - Searching and remove a variable

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > January 2006 > Searching and remove a variable





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Searching and remove a variable
contracer11@gmail.com

2006-01-09, 6:02 pm

Look this:

mediaid=WNT001

echo '/$mediaid/d|x' | ex - scratchtapes

Runnig this command I get :

Pattern not found

My question:

echo '/$mediaid/d|x' | ex - scratchtapes
^
|
How can I put a variable in this command ?

Thanks
Obrigado

Janis Papanagnou

2006-01-09, 11:01 pm

contracer11@gmail.com wrote:
> Look this:
>
> mediaid=WNT001
>
> echo '/$mediaid/d|x' | ex - scratchtapes
>
> Runnig this command I get :
>
> Pattern not found
>
> My question:
>
> echo '/$mediaid/d|x' | ex - scratchtapes
> ^
> |
> How can I put a variable in this command ?
>
> Thanks
> Obrigado
>


Single quotes will take the $ literally, while double quotes will expand
the enclosed variables. (You'll see that if you omit '| ex ...' part.)

Janis
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com