Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu User (http://www.linux-archive.org/ubuntu-user/)
-   -   awk – a print field question (http://www.linux-archive.org/ubuntu-user/637185-awk-print-field-question.html)

Johnny Rosenberg 02-24-2012 06:09 PM

awk – a print field question
 
Let's say that I have a string with an unknown number of spaces. How
can I assign all of them, except the two first ones to a variable?

For example:
x="This is an example of a sentence but you don't know how many words there is"

Now I want y to be "This is” and z to be "an example of a sentence but
you don't know how many words there is" using awk, but I can not
figure out how.

Any ideas?


Kind regards

Johnny Rosenberg
ジョニー・*ーゼンバーグ

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


All times are GMT. The time now is 07:47 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.