Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

i have the following text

A shell script is a (script) written for "the shell", or command line interpreter, of an operating system. The shell is [often] considered a "simple" domain-specific programming language.

i need to print the strings surrounded by double quotes only using script?

Thanks!

share|improve this question
    
Is this homework? –  RedGrittyBrick Apr 29 '12 at 13:41
    
Without knowing what OS/tools you have available, this would be impossible to answer. –  Journeyman Geek Apr 29 '12 at 13:42
    
@RedGrittyBrick dah man i've finish uni years ago ... –  Maxwell S. Apr 29 '12 at 13:42
    
@JourneymanGeek OS is Fedora 15 with bash shell. –  Maxwell S. Apr 29 '12 at 13:43

1 Answer 1

up vote 0 down vote accepted

So long as quoted strings dont span lines and don't contain quoted or escaped quotes:

$ perl -ne 'print "$1\n" while m!"([^"]+)"!g' maxwell.txt
the shell
simple

$ cat maxwell.txt
i have the following text

A shell script is a (script) written for "the shell", or command line interprete
r, of an operating system. The shell is [often] considered a "simple" domain-spe
cific programming language.

i need to print the strings surrounded by double quotes only using script?

Thanks!
$
share|improve this answer
    
thank you very much! –  Maxwell S. Apr 29 '12 at 13:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.