homepage Welcome to WebmasterWorld Guest from 54.198.140.182
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
Treating multiple lines as one?
Within shell
adni18




msg:3792292
 1:57 am on Nov 23, 2008 (gmt 0)

Hi there,

I have a small problem: I'm trying to download a page and extract a small bit of information from it (by splitting the page and then splitting the result of that split), but when I try to use awk to split the content, it seems to want to treat every line as a different input. How can I make it treat the entire piece as a whole?

Here's some sample code:


curl -A 'Mozilla/4.0' http://example.com ¦ awk '{split($0,a,"f");print a[2]}'

 

mcavic




msg:3794353
 3:28 am on Nov 26, 2008 (gmt 0)

Before the awk, try: tr '\n' ' '

That should turn the entire output into one line.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved