LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-12-2011, 06:30 PM   #16
xjx424
LQ Newbie
 
Registered: Apr 2011
Posts: 15

Original Poster
Rep: Reputation: 0

Ahhhh! I guess that would make sense. OK, switching the two now and trying, still not working but at least I have a chance now!
 
Old 04-12-2011, 07:54 PM   #17
xjx424
LQ Newbie
 
Registered: Apr 2011
Posts: 15

Original Poster
Rep: Reputation: 0
Still stuck!

If I use this
Code:
tar -zcvf "$al".tar.gz "$al"
I get the correctly named tar.gz file in the correct location...but when untar'ed it contains the folders and absolute path to the file

If I use this
Code:
tar -zcvf "$al".tar.gz "$(basename "$al")"
I get "Cannot stat: No such file or directory"

I don't understand how to point to just the folder which is "$(basename "$al")" and still include the full path as in the variable $al
 
Old 04-13-2011, 11:38 AM   #18
xjx424
LQ Newbie
 
Registered: Apr 2011
Posts: 15

Original Poster
Rep: Reputation: 0
Finally got it!

Code:
cd /var/www/hfandt.com/artists/
for dirname in */;
do
	cd /var/www/hfandt.com/artists/"$dirname"/
	for al in *;
		do
			tar -zcvf "$al".tar.gz "$al"
		done
done
 
  


Reply



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
What is the path for QCAD folder in Ubuntu? coss_cat Linux - Software 3 03-29-2011 02:22 PM
Add folder to perl path sir-lancealot Programming 1 06-08-2010 12:36 PM
Path to a share folder, how??? lefaman72 SUSE / openSUSE 4 02-26-2010 04:32 AM
How do you address a folder in another path Redbug Linux - Newbie 1 08-27-2008 11:06 AM
Cant move a folder to another path? dwarf007 Linux - Newbie 2 09-19-2004 02:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:50 AM.

Main Menu
Advertisement
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
Twitter: @linuxquestions
Open Source Consulting | Domain Registration