LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-21-2006, 09:00 AM   #1
dsids
Member
 
Registered: Mar 2006
Distribution: FC4
Posts: 184

Rep: Reputation: 31
script to untar a .gz file and then chown it for a user??


Hi,
Im trying to make a script which untar's a particular .gz file into a directory like /usr/local/src/
and then chown's the source directory using my Username

for eg:

Code:
#!/bin/sh

tar -xvzf abcd.gz -C /usr/local/src/

chown -R username.username /usr/local/src/abcd
Is it possible, as I normally have made a dir /home/username/software to download all source files and then untar it into /usr/local/src/. The problem comes up when I untar the .gz file as /usr/local/src/ is owned by root and I dont want to untar any file as root and then compile it.

Thanks
Danish
 
Old 08-21-2006, 10:40 AM   #2
seneschal
LQ Newbie
 
Registered: Jul 2006
Location: Minnesota
Distribution: RHEL, Debian, Ubuntu
Posts: 27

Rep: Reputation: 15
Is there something wrong with the example script you have there? It should work fine.
 
Old 08-23-2006, 01:42 AM   #3
dsids
Member
 
Registered: Mar 2006
Distribution: FC4
Posts: 184

Original Poster
Rep: Reputation: 31
Yes, there is. I do not want to name a particular software to untar. Id rather have it taken as $1 (eg /home/danish/abcd.tar.gz) And that later I can chown it when it is untarred in to the /usr/local/src/ directory.

Thanks
Danish
 
  


Reply


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
untar a file more than 2 GB hardian_97 Linux - Software 3 05-26-2006 06:32 AM
'Read-only file system' when untar a tar.bz2 file yinglcs Linux - General 1 02-18-2006 10:12 PM
python script needs root chown ability kosuke Programming 5 11-07-2004 05:14 PM
Bash script (untar *.tar files and then cd to the untared dir) k0ljat Linux - Newbie 2 12-30-2003 06:57 AM
untar more than one file? Sammy2ooo Linux - Newbie 1 12-23-2003 03:39 PM


All times are GMT -5. The time now is 04:57 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration