![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| chown | BG_JrAdmin | UNIX for Dummies Questions & Answers | 2 | 04-17-2009 08:22 AM |
| reg chown | ilayans | UNIX for Dummies Questions & Answers | 2 | 11-06-2008 07:34 AM |
| chown | ariec | AIX | 2 | 08-14-2007 04:24 PM |
| chown and permissions | ithost | UNIX for Dummies Questions & Answers | 1 | 07-03-2003 08:18 AM |
| chown and NIS | Jody | UNIX for Dummies Questions & Answers | 2 | 07-01-2003 02:57 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Trying to untar then chown, and chmod
I'm changing (trying to anyway) a script that will need to unrar a file, this file will create a directory with files in it. Then I need to change the owner ship and permission on that directory. Finally, I will rsync the directory to another machine.
This is what I have so far. #!/bin/bash ###Grab the name of the .trz file and unzip echo -e "Enter the name of the patch file: \c" read file tar -zxf $file ##### This is where I'm stuck, not sure what the next step is. ####Below was the original script that would rsynce the directory if the permissions were already set and the file was already untarred#### echo -e "Please enter the directory of patch (exclude trailing slash) : \c" read patch rsync -rpvgo --force $patch user@somemachine.com:/srv/patches rsync -rpvgo --force $patch user@somemachine.com:/srv/patches |
|
||||
|
Quote:
You say unrar but use tar? Not that I know how You use this script but maybe You could consider passing the filename as a parameter? Unless You are doing some looping here... What are You missing? Setting mode on the unpacked files? Do You know what settings You want? Do You know where You have unpacked the files? If, as an example, You have unpacked them in Your current, previously empty, working directory then I guess Code:
chmod -R 777 . chown -R user.user . |
![]() |
| Bookmarks |
| Tags |
| chmod, chown, tar |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|