Sponsored Content
Operating Systems Linux Korn Shell Script to change the permissions Post 302098273 by uhelp on Friday 1st of December 2006 04:21:55 PM
Old 12-01-2006
Question Korn Shell Script to change the permissions

Hi,
All

I am trying to change the permission for all the files in the current dir such that the user(owner) have the read write and excute permissions. When I excute the korn shell it will change the whole files and directory permissions as "rwx". Any help will be highly appreciated.

Thanks

Last edited by uhelp; 12-01-2006 at 05:44 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

korn shell script

hello., i have 2 files.. 1 file is in this folder /home/test/ssk/DSA.WLG.20050713211544.20050710.20050713211544 (this part) other file is in this folder /home/kk/dev/DSA.WLG.20050711210100.20050710.20050711210100 ... (1 Reply)
Discussion started by: pavan_test
1 Replies

2. Shell Programming and Scripting

script to change the access permissions of the files

Hi, I want to change the access permissions of the files whose extension is same.For example *.c but these are inside a directory and inside that other directory is there and it contains the .c files..for example-- So my aim is to search the files under src and change the access permissions... (3 Replies)
Discussion started by: smartgupta
3 Replies

3. UNIX for Advanced & Expert Users

script to recursively change permissions on file and dirs differently?

Hi there, I need to change all files/dirs 1. all files with 744 2. all dirs with 755 is there a script for that ? thanks, thegunman (13 Replies)
Discussion started by: TheGunMan
13 Replies

4. Shell Programming and Scripting

Korn Shell Script

I have to solve some exercises in Korn Shell, but i'm having some problems. For example: Write a korn shell script with an alfanumeric string as argument. The script lists the file's names in the current directory that contain the given string as substring and that can be read and written. I... (3 Replies)
Discussion started by: burm
3 Replies

5. Windows & DOS: Issues & Discussions

script to change widows update permissions

I want to allow windows update when ordinary users are logged on, I'm pretty sure that adjusting the permissions registry entry HEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/WindowsUpdate to allow acces to all domins users does the trick. I already have a logon.bat that runs at... (0 Replies)
Discussion started by: barrydocks
0 Replies

6. 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

7. Shell Programming and Scripting

Help on script to change permissions

Hi I have written the following script that later I want to put in cron,: #!/bin/bash _find="/usr/bin/find" _paths="/moneta_polled01/mediation_gsm /moneta_polled01/mediation_mmsc" for d in $_paths do $_find $d -type f -exec chmod 777 {} \; done but it does not seem to be... (8 Replies)
Discussion started by: fretagi
8 Replies

8. Shell Programming and Scripting

Change text color in Korn shell to highlight Error

Hi this is my first post, so forgive me if what I'm requesting doesn't make sense. I'm connecting into a Unix server via SSH and using a Korn Shell (#!/bin/ksh). The Unix server has Oracle 11g installed on it and there are a number of scripts already setup to query the Oracle database to perform... (2 Replies)
Discussion started by: KeithJ
2 Replies

9. Shell Programming and Scripting

Help on script to change permissions

Hi All I have the following script that is supposed to change permissions of incoming files to a directory, but it does not seem to do what I want, please can you help: mkdir -p /tmp/tmpdir find /moneta_polled01/sgsn/ -exec ls -l {} \; |grep -v rwxrwxrwx |awk '{print $9}' >... (4 Replies)
Discussion started by: fretagi
4 Replies

10. Shell Programming and Scripting

Script to change Permissions on files and directories

Hey, It's me again. Have a problem, that's not really a problem. I have the below script, that goes to the directory I want it to go to. lists out the directories available, lets you choose the directory you want, then it changes the permissions on said directory. using chmod -R and chown -R. ... (2 Replies)
Discussion started by: gkelly1117
2 Replies
umask(1)						      General Commands Manual							  umask(1)

NAME
umask - set or display the file mode creation mask SYNOPSIS
Set Mask Display Mask DESCRIPTION
The command sets the value of the file mode creation mask or displays the current one. The mask affects the initial value of the file mode (permission) bits for subsequently created files. Setting the File Mode Creation Mask The command sets a new file mode creation mask for the current shell execution environment. mask can be a symbolic or numeric (obsoles- cent) value. A symbolic mask provides a flexible way of modifying the mask permission bits individually or as a group. A numeric mask specifies all the permission bits at one time. When a mask is specified, no output is written to standard output. A symbolic mask replaces or modifies the current file mode creation mask. It is specified as a comma-separated list of operations in the following format. Whitespace is not permitted. [who][operator][permissions][, ...] The fields can have the following values: who One or more of the following letters: Modify permissions for user (owner). Modify permissions for group. Modify permissions for others. Or: Modify permissions for all = operator One of the following symbols: Add permissions to the existing mask for who. Delete permissions from the existing mask for who. Replace the existing mask for who with permissions. permissions One or more of the following letters: The read permission. The write permission. The execute/search permission. If one or two of the fields are omitted, the following table applies: | Format Entered Effect | Input Equals ---------------------------------------------------------+---------------- who Delete current permissions for who | operator No action | (none) permissions Equal to: | Delete current permissions for who | No action | (none) No action | (none) whopermissions Equal to: | operatorpermissions Equal to: | A numeric mask replaces the current file mode creation mask. It is specified as an unsigned octal integer, constructed from the logical OR (sum) of the following mode bits (leading zeros can be omitted): Displaying the Current Mask Value To display the current file mode creation mask value, use one of the commands: Print the current file mode creation mask in a symbolic format: The characters (read), (write), and (execute/search) represent the bits that are clear in the mask for (user/owner), (group), and (other). All other bits are set. Print the current file mode creation mask as an octal value. The zero bits in the numeric value correspond to the displayed and permission characters in the symbolic value. The one bits in the numeric value correspond to the missing permission characters in the symbolic value. Depending on implementation, the display consists of one to four octal digits; the first digit is always zero (see DEPENDENCIES). The rightmost three digits (leading zeros implied as needed) represent the bits that are set or clear in the mask. Both forms produce output that can be used as the mask argument to set the mask in a subsequent command. General Operation When a new file is created (see creat(2)), each bit that is set in the file mode creation mask causes the corresponding permission bit in the the file mode to be cleared (disabled). Conversely, bits that are clear in the mask allow the corresponding file mode bits to be enabled in newly created files. For example, the mask (octal disables group and other write permissions. As a result, files normally created with a file mode shown by the command as (octal become mode (octal while files created with file mode (octal become mode (octal Note that the file creation mode mask does not affect the set-user-id, set-group-id, or "sticky" bits. The file creation mode mask is also used by the command (see chmod(1)). Since affects the current shell execution environment, it is generally provided as a shell regular built-in (see DEPENDENCIES). If is called in a subshell or separate utility execution environment, such as one of the following: it does not affect the file mode creation mask of the calling environment. The default mask is (octal RETURN VALUE
exits with one of the following values: The file mode creation mask was successfully changed or no mask operand was supplied. An error occurred. EXAMPLES
In these examples, each line show an alternate way of accomplishing the same task. Set the value to produce read and write permissions for the file's owner and read permissions for all others displays on newly created files): Set the value to produce read, and write permissions for the file's owner, read-only for others users in the same group, and no access to others Set the value to deny read, write, and execute permissions to everyone Add the write permission to the current mask for everyone (there is no equivalent numeric mode): WARNINGS
If you set a mask that prevents read or write access for the user (owner), many programs, such as editors, that create temporary files will fail because they cannot access the file data. DEPENDENCIES
The command is implemented both as a separate executable file and as built-in shell commands. POSIX Shell and Separate File All features are supported (see sh-posix(1)). The numeric mask display uses a minimum of two digits. Korn Shell The option is not supported in the Korn shell built-in command (see ksh(1)). The numeric mask display uses a minimum of two digits. C Shell The option and symbolic mask values are not supported in the C shell built-in command (see csh(1)). The numeric mask display uses a mini- mum of one digit. SEE ALSO
chmod(1), csh(1), ksh(1), sh-posix(1), sh(1), chmod(2), creat(2), umask(2). STANDARDS CONFORMANCE
umask(1)
All times are GMT -4. The time now is 07:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy