Sponsored Content
Top Forums Shell Programming and Scripting testing file permissions..... Post 302388979 by bsnithin on Friday 22nd of January 2010 04:45:45 AM
Old 01-22-2010
This script should work. I also did use the code & verify. Can you check file permissions & file ownership details?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

testing for file size in script

Has anyone got a few tips on how I can test if the file size is 0? I am moving files on a regular basis from one location to another with ftp. The files which are 0 bytes in size we want to discard. Thankyou in advance. (3 Replies)
Discussion started by: Ivo
3 Replies

2. UNIX for Dummies Questions & Answers

Testing existence of a file /directory

hey guys How can i test existence of a file /directory in a directory in a script thanks (2 Replies)
Discussion started by: ajaya
2 Replies

3. HP-UX

To give the "unzip" permissions & "create" file permissions

Hi, I am a Unix Admin. I have to give the permissions to a user for creating new file in a directory in HP-Ux 11.11 system since he cannot able to create a new file in the directory. Thanks in advance. Mike (3 Replies)
Discussion started by: Mike1234
3 Replies

4. Shell Programming and Scripting

Testing for empty file

Hello, I need to determine if a file I have is empty or not. How can I go about doing this in shell scripting? Some sample code would be appreciated? Thanks, (6 Replies)
Discussion started by: mojoman
6 Replies

5. Shell Programming and Scripting

Retain file permissions when saving .sh file from internet [OS X]

Hello. I have written a bash script that I am sharing with an OS X community I am a member of. The purpose of the script is to execute a series of commands for members without them having to get involved with Terminal, as it can be daunting for those with no experience of it at all. I have renamed... (4 Replies)
Discussion started by: baza210
4 Replies

6. Shell Programming and Scripting

testing if a file is a directory

i have written this simple script called isdir.sh #! /bin/bash dir=$1 _ls=`ls $dir` for file in $_ls do if then echo "D $file" fi donethe output is not right. for example $ ./isdir.sh src ***no output*** but i have in ~/src some directories drwxr-xr-x 2... (5 Replies)
Discussion started by: and77
5 Replies

7. Shell Programming and Scripting

ksh; Change file permissions, update file, change permissions back?

Hi, I am creating a ksh script to search for a string of text inside files within a directory tree. Some of these file are going to be read/execute only. I know to use chmod to change the permissions of the file, but I want to preserve the original permissions after writing to the file. How can I... (3 Replies)
Discussion started by: right_coaster
3 Replies

8. Shell Programming and Scripting

Testing for one word in a file

I am trying to test the output of a file. What I have so far is this: if ]; then echo "yes";fi The problem with this is it works but I only want it to print out if the file contains the word "Compacted." The == sign means identical or equal to so it won't work. I tried ~ but that doesn't... (4 Replies)
Discussion started by: newbie2010
4 Replies

9. Shell Programming and Scripting

Changing file permissions of a file created by another user

Hi, I have used expdp for datapump. The .dmp file is created by the "oracle" user. my requirement is to make a zipped file of this .dmp file. What i am trying to do is change the permissions of this .dmp file from 0640 to 0644 and then do a gzip and zip it. Is there any way i can change... (3 Replies)
Discussion started by: qwertyu
3 Replies

10. UNIX for Dummies Questions & Answers

File and directory testing

original post -- I have a korn shell script that does some things that depend on creating and writing a file in a directory. I'm looking for a more elegant/efficient way to do the check than what I'm using now: if ] then print "Creating ${STGDIR}/${SHOW}" mkdir... (3 Replies)
Discussion started by: Dalej
3 Replies
DEVFS.CONF(5)						      BSD File Formats Manual						     DEVFS.CONF(5)

NAME
devfs.conf -- boot-time devfs configuration information DESCRIPTION
The devfs.conf file provides an easy way to set ownership and permissions, or create links for devices available at boot. It does not work for devices plugged in and out after the system is up and running, e.g. USB devices. See devfs.rules(5) for setting owner- ship and permissions for all device nodes, and devd.conf(5) for actions to be taken when devices are attached or detached. Lines starting with a hash sign ('#') and empty lines are ignored. The lines that specify devfs.conf rules consist of three parameters sepa- rated by whitespace: action The action to take for the device. The action names are only significant to the first unique character. devname The name of the device created by devfs(5). arg The argument of the action. The actions currently supported are: link This action creates a symbolic link named arg that points to devname, the name of the device created by devfs(5). own This action changes the ownership of devname. The arg parameter must be in the form of an owner:group pair, in the same format used by chown(8). perm This action changes the permissions of devname. The arg parameter must be a mode as explained in chmod(1). FILES
/etc/devfs.conf /usr/share/examples/etc/devfs.conf EXAMPLES
To create a /dev/cdrom link that points to the first SCSI(4) CD-ROM, the following may be added to devfs.conf: link cd0 cdrom Similarly, to link /dev/cdrom to the first ATAPI CD-ROM device, the following action may be used: link acd0 cdrom To set the owner of a device, the own action may be specified: own cd0 root:cdrom To set the permissions of a device, a perm action should be used: perm cd0 0660 SEE ALSO
chmod(1), devd.conf(5), devfs(5), devfs.rules(5), chown(8) AUTHORS
This manual page was written by Roland Smith <rsmith@xs4all.nl>. BSD
May 17, 2005 BSD
All times are GMT -4. The time now is 10:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy