LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Tags used in this thread
Popular LQ Tags , ,

Reply
 
Thread Tools
Old 08-18-2009, 09:50 AM   #1
dlugasx
Member
 
Registered: Dec 2008
Location: Germany/Poland
Distribution: CentOS 5.2 / Debian /
Posts: 124
Thanked: 1
script - problem with reading file name


[Log in to get rid of this advertisement]
Hello everyone,



this time I have a problem with script which should read file names.

My backup script for SVN generating such a files:




Quote:
#! folder_with_repositories+repositoryname.tgz
where foldername means directory with repositories.


in the linux directory tree it looks like this:


Quote:
/svn/folder_with_repositories
|
|
- repositoryname
|
- repositoryname01
|
- etc. etc.....

In my restore script I would like to read a part of the backup file name.

First I would like to ready part till "+" and then part after "+".


So, using the name of the backup file I would like to restore SVN directory tree.


If file has a name:

INPUT

Quote:
#! folder_with_repositories+repositoryname.tgz
I would like to have a command which will create folder using backup file name.


OUTPUT

Quote:
/svn/folder_with_repositories
|
|
- repositoryname
Name till "+" means folder with repositories.

Name after "+" maens folder with repository.


Do You know how can I do this ? AWK ?


Extensions .tgz from the file should be droped.


help...

Last edited by dlugasx; 08-19-2009 at 03:47 AM..
dlugasx is offline  
Tag This Post , ,
Reply With Quote
Old 08-18-2009, 03:22 PM   #2
catkin
Senior Member
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Slackware 13.0
Posts: 1,864
Blog Entries: 6
Thanked: 226
Can you post that again using code tags? That's CODE and /CODE in [] brackets. If you switch to advanced mode there's a # icon that automates it.
catkin is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading a conf file from a BASH script dinolinux Programming 5 08-03-2005 05:18 AM
Need help reading text file in bash script scilec Programming 3 11-25-2004 07:44 PM
Bash script - reading from text file twantrd Programming 4 11-24-2004 01:38 AM
reading file, bash script marri Programming 3 11-15-2004 10:13 AM
Script, Reading a file, When end of file? elibm Programming 2 07-16-2001 12:01 PM


All times are GMT -5. The time now is 06:08 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration