Sponsored Content
Homework and Emergencies Homework & Coursework Questions changing permissions of a file whos name was passed to 755 Post 302398390 by anix007 on Wednesday 24th of February 2010 12:04:24 PM
Old 02-24-2010
Tools changing permissions of a file whos name was passed to 755

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

1. The problem statement, all variables and given/known data:

Write a shell script that gives a passed file the "755" access permissions. The shell script should:
Change permissions of the file whose name was passed to 755
The shell script should display a message that the named file (name to be displayed inside ") access change was made.
The shell script should output the result of the ls -l command for that file only.
 
Modify the script above so that it assigns a passed file a set of passed access permissions


2. Relevant commands, code, scripts, algorithms:

Use the ls -l command for the specific file to show the changes were made.
755.*

3. The attempts at a solution (include all code and scripts):

My attempts aren't very relevant as I am not quite sure what they are asking me to do. Is it that once I change filename to "755" the permissions will automatically change? Or when i run this script it will change all filenames with the name 755 to having permissions of 755. Will 755.* work so that it will change all filenames with the name and any extension to having the permissions set to 755?

4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Sage College, Albany NY, USA, Leroy, CSI221 Linux for Net. Admin.

Edit: Continued here...

Last edited by Scott; 02-24-2010 at 05:10 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

changing file permissions

Use the following to Change permission of fileB (fileB could be fileB*) to change its permission same as the permission of fileA. chmod `ls -l fileA | awk '{pr int "u+", substr($1,2,1), substr($1,3,1), substr($1,4,1), ",g+", substr($1,5,1), substr($1,6,1), substr($1,7,1), ",o+",... (0 Replies)
Discussion started by: gagansharma
0 Replies

2. Shell Programming and Scripting

Changing Permissions

Is it possible to change the permissons for an entire directory in one shot? I'm telneting on to a linux server. ...just a beginner-- --Paul (4 Replies)
Discussion started by: pdavid
4 Replies

3. UNIX for Advanced & Expert Users

Changing file permissions on upload

Hello ! When I connect to a RH FTP server, the files I transfer (from my "windows computer") to this server have the following permissions : -rw------- but I would like those files to have the following permissions : - rw-rw-r-x How can I do that ??? :) Thanks for your help ! G. (6 Replies)
Discussion started by: guix
6 Replies

4. UNIX for Dummies Questions & Answers

changing default file permissions

How can I change the default permissions that are assigned when I create a file? (By default the file has: -rw-r--r-- ..... I'd like it to be -rw-r----- How can I change this default behavior? (8 Replies)
Discussion started by: FredSmith
8 Replies

5. UNIX for Dummies Questions & Answers

Changing file permissions

Is there a way to change a unix user's default file permissions so that when he creates a file, by default permissions are 777??? Thanks! (7 Replies)
Discussion started by: FredSmith
7 Replies

6. UNIX for Dummies Questions & Answers

changing permissions on a 444 file (ie chmod 444)

if I have a file set to permisions 444 (r-- r-- r--) should anyone other than the owner and root be able to change these permissions or delete the file. Apologies if this is a no-brainer but I cant test it myself and someone in our organisation is playin around with files they shouldnt be (1 Reply)
Discussion started by: ajcannon
1 Replies

7. Cybersecurity

changing /cn@0:console file permissions

I'm doing a security sweep of a Sun Sol 5.8 system. The file: /dev/console, which links to /devices/pseudo/cn@0:console, has the following perms: crw--w--w- I would like to get rid of the world write permissions. I can change the file permissions, but as soon as log back in, they are changed... (4 Replies)
Discussion started by: ErnieG
4 Replies

8. Shell Programming and Scripting

HELP changing file permissions

does anyone know how to write a script that will change file permissions. because the Admin blocked me from altering any of my files im only allowed to read and i heard a script like this can bypass it but i dont know how to write it. Display current users. Display user Ids only. Display... (10 Replies)
Discussion started by: live2learn
10 Replies

9. Homework & Coursework Questions

changing permissions of a file whos name was passed to 755

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a shell script that gives a passed file the "755" access permissions. The shell script should: Change... (5 Replies)
Discussion started by: anix007
5 Replies

10. 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
mkproto(8)							    Unsupported 							mkproto(8)

Name
       mkproto - construct a prototype file system

Syntax
       /etc/mkproto special proto

Description
       The  command  is used to bootstrap a new file system.  First a new file system is created using The command is then used to copy files from
       the old file system into the new file system according to the directions found in the prototype file proto.  The  prototype  file  contains
       tokens  separated by spaces or new lines.  The first tokens comprise the specification for the root directory.  File specifications consist
       of tokens giving the mode, the user-id, the group id, and the initial contents of the file.  The syntax of the contents	field  depends	on
       the mode.

       The mode token for a file is a 6 character string.  The first character specifies the type of the file.	(The characters -bcd specify regu-
       lar, block special, character special and directory files respectively.)  The second character of the type is either u or - to specify set-
       user-id	mode or not.  The third is g or - for the set-group-id mode.  The rest of the mode is a three digit octal number giving the owner,
       group, and other read, write, execute permissions.  See

       Two decimal number tokens come after the mode; they specify the user and group ID's of the owner of the file.

       If the file is a regular file, the next token is a pathname whence the contents and size are copied.

       If the file is a block or character special file, two decimal number tokens follow which give the major and minor device numbers.

       If the file is a directory, makes the entries .	and ..	and then reads a list of names	and  (recursively)  file  specifications  for  the
       entries in the directory.  The scan is terminated with the token $.

       A sample prototype specification follows:

       d--777 3 1
       usr  d--777 3 1
	    sh	 ---755 3 1 /bin/sh
	    ken  d--755 6 1
		 $
	    b0	 b--644 3 1 0 0
	    c0	 c--644 3 1 0 0
	    $
       $

Restrictions
       You can only run on virgin file systems.  It should be possible to copy files into existent file systems.

See Also
       dir(5), fs(5), fsck(8), newfs(8)

																	mkproto(8)
All times are GMT -4. The time now is 08:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy