-f Unlink. If a file descriptor for a destination file
cannot be obtained, attempt to unlink the destination
file and proceed.
...
/usr/bin/cp
The following option is supported for /usr/bin/cp only:
-p Preserve. cp duplicates not only the contents of
source_file, but also preserves the owner and group
id, permissions modes, modification and access time,
and ACLs if applicable. Note that the command may fail
if ACLs are copied to a file system that does not sup-
port ACLs. The command will not fail if unable to
preserve modification and access time or permission
modes. If unable to preserve owner and group id, cp
will not fail, and it will clear S_ISUID and S_ISGID
bits in the target. cp will print a diagnostic message
to stderr and return a non-zero exit status if unable
to clear these bits.
In order to preserve the owner and group id, permis-
sion modes, and modification and access times, users
must have the appropriate file access permissions;
this includes being superuser or the same owner id as
the destination file.
however, i've never really used the "-f" option --- like most other esoteric options of other commands that are good to know but not required for basic stuff --- so i don't actually understand the unlink statement ... maybe one of the hardcore c programmers here can explain it better ...
do look at this test here and you can decide what it is you need ...
Hi,
I'm ssh-in to a remote machine (ubuntu) and trying to execute a little script in there.The script looks like this:
ssh user@ubuntu <<EOF
cd ~/test
ls -l
echo "Continue counting files starting with a`s ?"
read answer
if
then
ls -l a*
else
exit
fi
EOF
Now everything works... (9 Replies)
I have a file that is 20 - 80+ MB in size that is a certain type of log file.
It logs one of our processes and this process is multi-threaded. Therefore the log file is kind of a mess. Here's an example:
The logfile looks like: "DATE TIME - THREAD ID - Details", and a new file is created... (4 Replies)
Hi all,
I am writing a script (.sh) which takes backup of database, zip it ftp to remote server and finally mail me to notify. So far this all has been done, however, now I am looking to add notification over each step. Means if any step is failed, then I should get an email and if all goes... (2 Replies)
Please help what is wrong in below script. It is printing else also,
else
echo "DATABASE NOT RUNNING :${i}
=================================================
#!/usr/bin/ksh
set -A DBS $(cat /etc/oratab | grep ":Y" | awk -F : '{print $1}')
set -A RDBS $(ps -ef | grep -i pmon | grep... (3 Replies)
hi,
I have some problems in my simple script about the redirect echo stdout command inside a condition. Why is the echo command inside the elif still execute in the else command
Here are my simple script
After check on the two diff output the echo stdout redirect is present in two diff... (3 Replies)
Hello
newbies question...
I just need a script able to launch a command when a condition is matched :
#!/bin/ksh
SIZ = 'cat /nurp/control.lst|wc -l'
if test "$SIZ" -gt 0
then
echo 1
else
echo 2
fi
but I receive errors messages
./t2: SIZ: not found
2
whats wrong ? (5 Replies)
while
do
if ;then
read driverName
else
driverName=""
fi
done
can anyone please explain what exactly is happening on 1st line...is it like the conditions being ORed...I have no clue about this. (4 Replies)
HI
My doubt may be basic one but I need to get it clarified..
When i use "if" condition that checks for many AND, OR logical conditions
like
if ]; then
return 0
fi
Even the if condition fails it returns as zero.. Any clue..
But if i add else condition like
if ]; ... (2 Replies)
I wrote a code to find codons in a DNA string. The only problem I have is how do I make the code only work for a file with DNA. This means the file only has the characters a,c,g,t and no white space characters. (3 Replies)
I want get from user and pass these parameters to bash script. script should copy files in user home directory.
FYI: each file might be exist or not, might be one of them exist or four of them.
Here is my script, it always copy file1 and seems only one of them execute!
#!/bin/bash
for... (6 Replies)
Discussion started by: indeed_1
6 Replies
LEARN ABOUT HPUX
getacl
getacl(1) General Commands Manual getacl(1)NAME
getacl - list access control lists (ACLs) for files (JFS File Systems only)
SYNOPSIS
file...
DESCRIPTION
For each argument that is a regular file, special file, or named pipe, displays the owner, group, and the Access Control List (ACL). For
each directory argument, displays the owner, group, and the ACL and/or the default ACL. Only directories contain default ACLs.
With the option specified, the filename, owner, group, and the ACL of the file will be displayed. With the option specified, the filename,
owner, group, and the default ACL of the file, if it exists, will be displayed. With options not specified, the filename, owner, group,
and both the ACL, and the default ACL, if it exists, will be displayed.
This command may be executed on a file system that does not support ACLs. It will report the ACL consisting of only the owning user, own-
ing group, class and other entries, based on the permission bits.
When multiple files are specified on the command line, a blank line will separate the ACL for each file.
Options
The command recognizes the following options:
Displays the filename, owner, group, and the ACL of the specified file.
Displays the the filename, owner, group, and the default
ACL of the file, if it exists.
Operands
The command recognizes the following operand:
file The file or directory from which retrieves the access control information.
ACL Format
The format of an ACL is:
The first three lines show the filename, the file owner, and the file owning group. Note that when only the option is specified, and the
file has no default ACL, only these three lines will be displayed.
The entry without a user ID indicates the permissions that will be granted to the owner of the file. One or more additional entries indi-
cate the permissions that will be granted to the specified users. The entry without a group identifier indicates the permissions that will
be granted to the owning group of the file. One or more additional entries indicate the permissions that will be granted to the specified
groups. The entry indicates the permissions that will be granted to others.
The entries and may only exist for directories, and indicate the default user, group, and other entries that will be added to a file cre-
ated within the directory.
The uid is a login name, or a user ID if there is no entry for the uid in the system's password file; gid is a group name, or a group ID if
there is no entry for the gid in the system's group file; and perm is a three character string composed of the letters representing the
separate discretionary access rights: (read), (write), (execute/search), or the placeholder character The perm will be displayed in the
following order: If a permission is not granted by an ACL entry, the placeholder character will appear.
The ACL entries will be displayed in the order in which they will be evaluated when an access check is performed. The default ACL entries
that may exist on a directory have no effect on access checks.
The file owner permission bits represent the access that the owning user ACL entry has. The file group class permission bits represent the
most access that any additional user entry, additional group entry, or the owning group entry may grant. The file other permission bits
represent the access that the other ACL entry has. If a user invokes the command and changes the file group class permission bits, the
access granted by the additional ACL entries may be restricted.
In order to indicate that the file group class permission bits restrict an ACL entry, will display, after each affected entry, text in the
form , where perm will show only the permissions actually granted.
EXAMPLES
Given file with an ACL six entries long, the command
would print:
Given file with an ACL six entries long, after the command was issued, the command
would print:
Given directory with an ACL containing default entries, the command
would print:
Given directory the command
would print:
NOTICES
The output from will be in the correct format for input to the command. If the output from is redirected to a file, the file may be used
as input to In this way, a user may easily assign one file's ACL to another file.
FILES
for user IDs
for group IDs
SEE ALSO chmod(1), ls(1), setacl(1). acl(2), aclsort(3C).
getacl(1)