CFanatic

Go Back   CFanatic > Programming > Shell Scripting

Join CFanatic Forum Now

Parsing strings topic posted under Shell Scripting which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 09-30-2010, 03:01 AM
Junior Member
 
Join Date: Sep 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
pnat331 is on a distinguished road
| More
Parsing strings

I need help parsing this bit of text into the output shown below:

Text:
dump database abc123 to 'compress::0::/dbdumps/abc123_20100930_1251:00.dump1'
stripe on 'compress::0::/dbdumps/abc123_20100930_1251:00.dump2'
go
dump database abc_def to 'compress::0::/dbdumps/abc_def_20100930_1251:00.dump1'
go

Here abc123 and abc_def are database names

Dump files for database abc123 will be created in 2 stripes and will be saved as:
dbdumps/abc123_20100930_1251:00.dump1
dbdumps/abc123_20100930_1251:00.dump2

The dump file for database abc_def will be saved as:
abc123_20100930_1251:00.dump2'

What I am trying to do is to create soft links as below
abc123.dump1->abc123_20100930_1251:00.dump1
abc123.dump2->abc123_20100930_1251:00.dump2
abc_def.dump1->abc_def_20100930_1251:00.dump1

In the output the first word is the database name (which may be alphanumeric and may also have underscores and hyphens). The dump[n] prefix is what exists on the dump file name and should be appended to the database name to create the soft link.

Any suggestions on how this can be accomplished? I am using ksh.
Reply With Quote
Reply

Thread Tools
Display Modes

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 Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strings of characters miznogud C++ Programming 0 08-31-2010 09:51 PM
problems with strings David_Omid C++ Programming 0 08-30-2010 07:21 PM
Parsing text file through a batch Grep Shell Scripting 0 08-28-2010 03:11 AM
Parsing the Address string pranit saindani MFC Programming 0 07-08-2010 07:38 AM
Output differences between 2 strings codeunlock C# Programming 2 09-08-2008 02:26 AM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 03:08 AM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board