Sponsored Content
Top Forums Shell Programming and Scripting Checking directory permissions on UNIX directory Post 302540576 by yazu on Thursday 21st of July 2011 05:39:34 AM
Old 07-21-2011
Shell is not perl (in the last version of perl you can use these operators in such manner - "-rwx" ). In shell you can use:

Code:
if [ ! -r $dir ] && [ ! -w $dir ] && [ ! -x $dir ]
...

Or
Code:
$ dir=$HOME
$ test -r $dir -a -w $dir -a -x $dir && echo hi
hi
$ dir=/etc
$ test -r $dir -a -w $dir -a -x $dir && echo hi
$


Last edited by yazu; 07-21-2011 at 06:54 AM.. Reason: another variant
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Unix directory permissions for Samba

Hi, I've installed Samba on an AIX machine and configured smb.conf to have a bunch of shares available to Windows. I can see the shares, but I couldn't access them. After about 30 minutes of chmod'ding if finally got access by doing the following to the directories I shared: chmod -R... (2 Replies)
Discussion started by: szahir1
2 Replies

2. UNIX for Dummies Questions & Answers

moving files from a unix directory to a windows directory

Any body any ideas i'm failry new to this so any help would be appreciated. Cheers Steve (2 Replies)
Discussion started by: gleads
2 Replies

3. Shell Programming and Scripting

Checking and chaning directory permissions automatically

Hi all, My first post here. I need a small script to check the directory permssions on my /home/uploads and if there are any newly created directory in uploads chmod them to 1777. The upload directory is for my users who upload their pictures and I by default their directories are given... (4 Replies)
Discussion started by: apachi
4 Replies

4. Shell Programming and Scripting

determine owner directory permissions from within the directory

From within a directory, how do I determine whether I have write permission for it. test -w pwd ; echo ? This doesn't work as it returns false, even though I have write permission. (4 Replies)
Discussion started by: Sniper Pixie
4 Replies

5. UNIX for Dummies Questions & Answers

unix directory permissions

Hi All I am using cygwin and if i type ls -l it is giving like drwxr-xr-x+ for directories. My question is what is the meaning of '+' sign at the end? its not giving that '+' sign for files. Thank you (1 Reply)
Discussion started by: Usha Shastri
1 Replies

6. Shell Programming and Scripting

Move a file from windows directory to unix directory

Move a file from windows directory to unix directory, is this possible? if it is, can someone help me on this? Thanks! God bless! (1 Reply)
Discussion started by: kingpeejay
1 Replies

7. Shell Programming and Scripting

File transfer from one directory to another directory in unix

Hi, I have to transfer five files from one directory to another directory in unix with the help of shell scripts. This shell script calling the param file as input parameter. Every day one file will come and fall on my source directory. Remaining files will fall on any one of the day of the... (5 Replies)
Discussion started by: easterraj
5 Replies

8. Solaris

Directory Permissions for 2 users on 1 directory

we want to allow user to FTP files into a directory, and then the program (PLSQL) will read and process the file, and then move the file to other directory for archiving. the user id: uftp1, group: ftp the program run in oracle database, thus have the user Id: oraprod, group: dba how to... (2 Replies)
Discussion started by: siakhooi
2 Replies

9. UNIX for Dummies Questions & Answers

Directory (and sub-directory) permissions...

Hi, I had a newbie question on giving permissions to directories and subdirectories. I am one of the users in a group. The top level directory (say directory 'X' - owned by someone else) has the following permissions: drwxrwxrwx It also has a subdirectory, say 'Y', (which in turn has... (5 Replies)
Discussion started by: pc2001
5 Replies

10. UNIX for Dummies Questions & Answers

Extract directory name from the full directory path in UNIX using shell scripting

My input is as below : /splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt /splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt /splunk/scrubbed/loyal/IFIND.HELLO.WROC.txt /splunk/scrubbed/triumph/ifind.triumph.txt From the above input I want to extract the file names only . Basically I want to... (5 Replies)
Discussion started by: IshuGupta
5 Replies
gvfs-monitor-dir(1)						   User Commands					       gvfs-monitor-dir(1)

NAME
gvfs-monitor-dir - monitor the change of a directory content using the VFS system SYNOPSIS
gvfs-monitor-dir URI DESCRIPTION
gvfs-monitor-dir monitors the change content of a directory using the VFS system. If anything changes inside the directory, gvfs-monitor- dir will print a message informing of the event. OPERANDS
The following operands are supported: URI Specifies the directory location in standard URI format. EXAMPLES
Example 1: Monitor a local directory example% gvfs-monitor-dir file:///tmp/example ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables: NLSPATH. EXIT STATUS
The exit value 0 is returned regardless of success or failure. FILES
The following files are used by this application: /usr/bin/gvfs-monitor-dir Executable to monitor the change content of a directory using the VFS system. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-gvfs | +-----------------------------+-----------------------------+ |Interface stability |Volatile | +-----------------------------+-----------------------------+ SEE ALSO
gvfs-copy(1), gvfs-info(1), gvfs-less(1), gvfs-ls(1), gvfs-mkdir(1) gvfs-cat(1), gvfs-monitor-file(1), gvfs-mount(1), gvfs-move(1), gvfs- rename(1), gvfs-open(1), gvfs-rm(1), gvfs-save(1), gvfs-trash(1), gvfs-tree(1), attributes(5), environ(5) NOTES
Written by Alvaro Lopez Ortega, Sun Microsystems Inc., 2008. SunOS 5.11 25 Mar 2008 gvfs-monitor-dir(1)
All times are GMT -4. The time now is 05:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy