permissions + shell


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting permissions + shell
# 1  
Old 04-15-2004
permissions + shell


this is that the question is asking me:


Make the following three changes to your '.bash_profile' startup file.
Add three new lines to the end of the file, one for each of the following
tasks:

Change your primary prompt to display the name of your current directory,
followed by a colon (Smilie, then followed by a single space.

Add a directory called 'scripts' as the last directory in your path.
'scripts' is a subdirectory of your home directory. (Warning: don't use
single quotes in this command)

Add the command to change default permissions for newly-created files
and directories. Ensure that you have full permissions on newly-created
directories and everybody else has no permissions.


this is what I did


# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:$home/scripts
BASH_ENV=$HOME/.bashrc
USERNAME=""
PS1='\u: '
$ umask u=rwx,o=



export USERNAME BASH_ENV PATH


PLEASE HELP!
# 2  
Old 04-15-2004
see man umask for more details [edit] Since umask is a builtin you wont get much with the man page. I suggest you pick up O'Reilly's "Unix In A Nutshell" to better your unix command understanding.

try using the octal values instead. I think they are easier to read in my opinion. Note that when the mode is interpreted as an octal number, each number of the umask is subtracted from 7. Thus, a umask of 022 results in permissions of 755.

umask 022

wait a tick! This is homework! See the rules.....

Last edited by google; 04-15-2004 at 04:39 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Setting permissions for shell scripts

Hi, I have written a shell script which calls a java program which reads properties from a configuration file and writes to a log file for each session.However the customer wants that the user should not be able to open/edit the configuration file or the log files meaning they should not... (4 Replies)
Discussion started by: jayadrath
4 Replies

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

3. UNIX for Dummies Questions & Answers

Changing permissions in a shell script

Hi All, I have a shell script which we keep on changing permissions on a On-Demand Basis-->for e:g--from 400(Read only) to 740(Execute permission) etc. Is there any way by which I can view the history of the script?-->I am interested in finding out the date-time stamps when the script's... (2 Replies)
Discussion started by: DevotedPupil
2 Replies

4. Shell Programming and Scripting

Shell Script to save/restore files and dir permissions

Hello all: I need found script to save and restore file permissions and owner:group... this is for backup my server... I have one problem in my server and file permissions and owner:group, mess up.. For this reason i need found one way to secure this aspect of the server... Thanks! (1 Reply)
Discussion started by: joangopan
1 Replies

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

6. Shell Programming and Scripting

file permissions using shell scripting

Hi I am trying to use shell script to display file permissions, and I can do it fine for the current user logged in, but now I want to view all file permissions for the Owner of the file, Group users and everyone, so it will look something like this: -----------------READ WRITE EXECUTE OWNER... (11 Replies)
Discussion started by: barbus
11 Replies

7. Linux

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 (1 Reply)
Discussion started by: uhelp
1 Replies

8. Shell Programming and Scripting

Shell script permissions

Hi, I'm trying to execute a shell script from application (Informatica). The script works fine when I execute it from command line but fails when executed from Informatica. The tricky part is that there is other scripts in the same folder that can be executed succesfully from both command line... (1 Reply)
Discussion started by: tmikahan
1 Replies

9. UNIX for Dummies Questions & Answers

Permissions

Hi everyone, I'm looking for some information concerning Unix permissions. I am new to Unix and am doing research for a graduate class. Given the permissions below, can anyone give me five unique exploits that would be available to a hacker/cracker given this configuaration? -rw-rw-rw- 1... (1 Reply)
Discussion started by: skeeter
1 Replies

10. UNIX for Dummies Questions & Answers

cp -p and permissions

Hi all. Her's what i want to do: -> copy a file from /tmp to /usr/local/bin, and then give this file the default owner of /usr/local/bin. My /usr/local/bin belongs to root:sys. When i detar the file mentionned, it keeps the rights it was created with. How can i achieve what i want to do? A cp... (1 Reply)
Discussion started by: penguin-friend
1 Replies
Login or Register to Ask a Question