The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Perl: Search for string on line then search and replace text Crypto Shell Programming and Scripting 4 01-04-2008 10:24 AM
Search for a pattern from the result of search boopathi_d Shell Programming and Scripting 3 12-05-2007 09:54 AM
Search for \n Chanakya.m Shell Programming and Scripting 6 07-19-2006 07:57 AM
Advanced Search Problems.. Search by User Name Neo Post Here to Contact Site Administrators and Moderators 1 05-19-2003 01:28 AM
Search using sed Ohji UNIX for Dummies Questions & Answers 1 08-14-2001 11:21 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-10-2008
agarwal agarwal is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 24
Search for qoutes

Suppose i have a text as below:

"abc"
abc("abc")
lmn("abc")

I want to search for the qoutation of the first line and if qoutation found, then save it to another file. How can i do that?
  #2 (permalink)  
Old 04-10-2008
nua7 nua7 is offline
Registered User
  
 

Join Date: Mar 2008
Location: /bin/sh
Posts: 353
cat file1 | grep '\"'|tail -1 > file2
  #3 (permalink)  
Old 04-10-2008
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,538
Code:
awk 'NR==1 && /\"/{print}' file
  #4 (permalink)  
Old 04-10-2008
agarwal agarwal is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 24
I have got the answer.
grep '^"' test1.txt
  #5 (permalink)  
Old 04-10-2008
krishmaths krishmaths is offline
Registered User
  
 

Join Date: Sep 2006
Location: Mysore, India
Posts: 191
@agarwal:

You've framed your question incorrectly. It does not describe your requirement, according to the solution you've posted yourself now.

This has lead experts provide answers for your incorrect statement. Take care of this in future.

Cheers!
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:47 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0