you are running as a root user, try changing ownership of the file to some other user and then test..
That won't make a difference. As RudiC stated, if the shell is privileged, the read test will always succeed.
---------- Post updated at 03:00 PM ---------- Previous update was at 02:47 PM ----------
This is what lies behind bash's implementation, from lib/sh/eaccess.c:
In that code, "mode" is an integral value representing what is being tested (reading = R_OK, writing = W_OK, executable = X_OK, a regular file = F_OK, etc).
cat .servers | while read LINE; do
ssh jason@$LINE $1
done
exit 1
./command.ksh "ls -l ~jason"
Why does this ONLY iterate on the first server in the list? It's not doing the command on all the servers in the list, what am I missing?
Thanks!
JP (2 Replies)
Howdie everyone...
I have a shell script RemoveFiles.sh
Inside this file, it only has two commands as below:
rm -f ../../reportToday/temp/*
rm -f ../../report/*
My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
hi
I wrote the following makefile, I have just one problem, when i type make clean I get the message make 'clean' is up to date and any obj file is removed from my folder, what's wrong?
Thank you
CC = cc
all: es.o elaboration.o
$(CC) -o es es.o elaboration.o
elaboration.o:... (0 Replies)
Hi
I have put alias ll='ls -la' in .profile file but it doesn't work.
On hand it works it looks like the .profile file is not beeing read.
How to check whitch file is loaded? ,profile? .bash_profile?
My system: SunOS mion 5.10 Generic
Shell: /bin/pfksh
Thanks (2 Replies)
hello,
The command above seems not working on my solaris 8/9 sparc machines.
a. resulted to the ff below when I instead use "shutdown" only.
Broadcast Message from root (pts/1) on "hostname" date..
The system "hostname" will be shut down in 30 seconds
THE SYSTEM bdosg IS BEING SHUT... (4 Replies)
Hi - I want to compare permissions of the directory structure and files beneath it with permissions one week back on same directory structure and files beneath it. if any changes to permissions of any file or directory permissions send an email. I am not sure how to list the permissions of all... (1 Reply)
I have 10 application servers in a distributed architecture generating their own application logs. Each server has application utility to continuously tail the log. for example following command follows tails and follows new logfiles as they are generated
server1$ logutility logtype
When I run... (8 Replies)
Guys,
I've a xlsx file containing pivot tables and my job is to FTP it from one Linux terminal to another.
I use the script below :
ftp -in xxxx > /ftp.log 2>&1 <<EOT
user xxx yyyy
binary
cd <directory>
put xxx.xlsx `basename xxx.xlsx`
bye
EOT
After the file is received in the FTP... (2 Replies)
Hi,
I am using korn shell.
until ]
do
echo "\$# = " $#
echo "$1"
shift
done
To the above script, I passed 2 parameters and the program control doesn't enter inside "until" loop. If I change it to until ] then it does work.
Why numeric comparison is not working with -ne and works... (3 Replies)
Discussion started by: ab_2010
3 Replies
LEARN ABOUT CENTOS
eaccess
EUIDACCESS(3) Linux Programmer's Manual EUIDACCESS(3)NAME
euidaccess, eaccess - check effective user's permissions for a file
SYNOPSIS
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <unistd.h>
int euidaccess(const char *pathname, int mode);
int eaccess(const char *pathname, int mode);
DESCRIPTION
Like access(2), euidaccess() checks permissions and existence of the file identified by its argument pathname. However, whereas access(2),
performs checks using the real user and group identifiers of the process, euidaccess() uses the effective identifiers.
mode is a mask consisting of one or more of R_OK, W_OK, X_OK and F_OK, with the same meanings as for access(2).
eaccess() is a synonym for euidaccess(), provided for compatibility with some other systems.
RETURN VALUE
On success (all requested permissions granted), zero is returned. On error (at least one bit in mode asked for a permission that is
denied, or some other error occurred), -1 is returned, and errno is set appropriately.
ERRORS
As for access(2).
VERSIONS
The eaccess() function was added to glibc in version 2.4.
CONFORMING TO
These functions are nonstandard. Some other systems have an eaccess() function.
NOTES
Warning: Using this function to check a process's permissions on a file before performing some operation based on that information leads to
race conditions: the file permissions may change between the two steps. Generally, it is safer just to attempt the desired operation and
handle any permission error that occurs.
This function always dereferences symbolic links. If you need to check the permissions on a symbolic link, use faccessat(2) with the flags
AT_EACCESS and AT_SYMLINK_NOFOLLOW.
SEE ALSO access(2), chmod(2), chown(2), faccessat(2), open(2), setgid(2), setuid(2), stat(2), credentials(7), path_resolution(7)COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
2010-11-01 EUIDACCESS(3)