Sponsored Content
Full Discussion: cp, chown, untar
Top Forums Shell Programming and Scripting cp, chown, untar Post 302308181 by abinaya on Friday 17th of April 2009 10:09:31 AM
Old 04-17-2009
Hi,
check this out !

while read line
do
untar special.tar.gz -xvfz $line
cd $line
chown -R user409:user409 *
chmod -R 755 *
done < source.txt
 

10 More Discussions You Might Find Interesting

1. AIX

chown

hello chown not change ownership before: 205:system ~kuku chown kuku:system ~kuku after no change 205:system ~kuku aix box can someone help me? ariec (2 Replies)
Discussion started by: ariec
2 Replies

2. UNIX for Advanced & Expert Users

chown issue

I have a strange problem in my Linux box (Suse). Recently I took over this box as admin even though I have no prior admin experience. Following is my issue I had following users under 'root' group initially user1 user2 user3 Since I did not like user ids under root group. I modifed these... (9 Replies)
Discussion started by: praveenkumar_l
9 Replies

3. UNIX for Dummies Questions & Answers

Chgrp and Chown ???

Hi Can anybody please let me know the usage of Chgrp command with an example??? Thanks (1 Reply)
Discussion started by: skyineyes
1 Replies

4. UNIX for Dummies Questions & Answers

reg chown

hi i wrote a script to run 'C' executable which will create a new file, after that util is completed, i have to change the file ownership to some other user. for that i used "chown" for changing the file permission in Korn script :confused:but it is throwing error is "operation... (2 Replies)
Discussion started by: ilayans
2 Replies

5. Shell Programming and Scripting

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 ... (1 Reply)
Discussion started by: walkerl
1 Replies

6. UNIX for Dummies Questions & Answers

chown

is there a difference in chown on a file or a directory? how do i chown a directory and all the contents? (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies

7. AIX

Trouble in chown

I'm a owner of directories or files why I can't deliver the ownership of them up to other users? (1 Reply)
Discussion started by: kang
1 Replies

8. Shell Programming and Scripting

Chown - error

I have a file fin2009_4.txt.gz in the unix ftp server. Owner of the file is: ftpusr. -rw-r--r-- 1 ftpusr sap 0 Feb 19 10:19 fin2009_4.txt.gz When I try to delete this file after copying to my home folder, I am getting the following error. rm: fin2009_4.txt.gz1: override... (4 Replies)
Discussion started by: sid1982
4 Replies

9. Solaris

chown

Hello My oracledatabase creats some xmlfiles. this files has the owner hugo. now I've a script (how runs als hugo2) and this script will insert this XMLFile into the database. But that doesn't work, because the owner of the files is wrong, and hugo has not the rights to insert this files into... (3 Replies)
Discussion started by: Street
3 Replies

10. UNIX for Dummies Questions & Answers

Pls help. can't do chown ????

I am trying to change the directory to owner of Sybase. But I get permission denied. I did login as root. newd1> ls -l total 58 drwxr-xr-x 2 prod develop 5 Oct 17 06:51 bin drwxr-xr-x 2 prod develop 7 Oct 17 07:18 etc dr-xr-xr-x 1 root root 1... (15 Replies)
Discussion started by: samnyc
15 Replies
tar_extract_file(3)						  C Library Calls					       tar_extract_file(3)

NAME
tar_extract_file, tar_extract_regfile, tar_extract_hardlink, tar_extract_symlink, tar_extract_chardev, tar_extract_blockdev, tar_extract_dir, tar_extract_fifo, tar_skip_regfile, tar_set_file_perms - extract files from a tar archive SYNOPSIS
#include <libtar.h> int tar_extract_file(TAR *t, char *realname); int tar_extract_regfile(TAR *t, char *realname); int tar_skip_regfile(TAR *t); int tar_extract_dir(TAR *t, char *realname); int tar_extract_hardlink(TAR *t, char *realname); int tar_extract_symlink(TAR *t, char *realname); int tar_extract_blockdev(TAR *t, char *realname); int tar_extract_chardev(TAR *t, char *realname); int tar_extract_fifo(TAR *t, char *realname); int tar_set_file_perms(TAR *t, char *realname); VERSION
This man page documents version 1.2 of libtar. DESCRIPTION
The tar_extract_file() function acts as a front-end to the other tar_extract_*() functions. It checks the current tar header associated with the TAR handle t (which must be initialized first by calling th_read()) to determine what kind of file the header refers to. It then calls the appropriate tar_extract_*() function to extract that kind of file. The tar_skip_regfile() function skips over the file content blocks and positions the file pointer at the expected location of the next tar header block. The tar_set_file_perms() function sets the attributes of the extracted file to match the encoded values. This includes the file's modifi- cation time, mode, owner, and group. This function is automatically called by tar_extract_file(), but applications which call the other tar_extract_*() functions directly will need to call tar_set_file_perms() manually if this behavior is desired. RETURN VALUES
On successful completion, the functions documented here will return 0. On failure, they will return -1 and set errno to an appropriate value. The tar_extract_dir() function will return 1 if the directory already exists. ERRORS
The tar_extract_file() function will fail if: EEXIST If the O_NOOVERWRITE flag is set and the file already exists. The tar_extract_*() functions will fail if: EINVAL An entry could not be added to the internal file hash. EINVAL Less than T_BLOCKSIZE bytes were read from the tar archive. EINVAL The current file header associated with t refers to a kind of file other than the one which the called function knows about. They may also fail if any of the following functions fail: mkdir(), write(), link(), symlink(), mknod(), mkfifo(), utime(), chown(), lchown(), chmod(), or lstat(). SEE ALSO
mkdir(2), write(2), link(2), symlink(2), mknod(2), mkfifo(2), utime(2), chown(2), lchown(2), chmod(2), lstat(2) University of Illinois Jan 2001 tar_extract_file(3)
All times are GMT -4. The time now is 06:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy