Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 08-18-2009, 08:50 AM   #1
Registered: Dec 2008
Location: Germany/Poland
Distribution: CentOS / Debian / Solaris / RedHat
Posts: 262

Rep: Reputation: 18
script - problem with reading file name

Hello everyone,

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

My backup script for SVN generating such a files:

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

in the linux directory tree it looks like this:

- 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:


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


- 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.


Last edited by dlugasx; 08-19-2009 at 02:47 AM.
Old 08-18-2009, 02:22 PM   #2
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian except for netbook still on Slackware 13.37 (and I have to support Ubuntu)
Posts: 8,572
Blog Entries: 30

Rep: Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182
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.


file, name

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 04:18 AM
Need help reading text file in bash script scilec Programming 3 11-25-2004 06:44 PM
Bash script - reading from text file twantrd Programming 4 11-24-2004 12:38 AM
reading file, bash script marri Programming 3 11-15-2004 09:13 AM
Script, Reading a file, When end of file? elibm Programming 2 07-16-2001 11:01 AM

All times are GMT -5. The time now is 07:02 AM.

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