file permissions using shell scripting


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
# 8  
i have to start someware Smilie
# 9  
Laziness???

If you are not allowed to use the correct tools for the job then I suggest you kick up a fuss.
Unix utilities are there to be used not ignored because of someone's prejudices.
You have my sincere sympathies
# 10  
i assume he is doing this, because he wants me to grasp some concepts, he did say i can use sed and awk once am confirtable doing stuff without them Smilie

i have only being using unix for about 2 weeks now after all.

can we get to the problem in hand please Smilie

Quote:
is it possible to redirect the string of permissions like rwxr-wr-- to a variable/tmp?
and can the find function be used to display something like the 1st string of 10 characters from a line?

Last edited by barbus; 10-02-2007 at 08:53 AM..
# 11  
not exactly, but something to start with:
Code:
#!/bin/ksh

echo -n "please enter file name : "
read file

echo "      READ WRITE EXECUTE"
getfacl "${file}" | while IFS=':' read what junk perm
do
   case "${what}" in
      user|group|other)
             echo "${what} $(echo ${perm} | sed -e 's/[rwx]/ YES /g' -e 's/-/ NO /g')"
             ;;
   esac
done


Last edited by vgersh99; 10-02-2007 at 10:23 AM..
# 12  
that help me out a LOT, thank you, thank you all Smilie
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #42
Difficulty: Easy
In general, cookies are created by web clients and stored on web servers.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read csv file, convert the data and make one text file in UNIX shell scripting

I have input data looks like this which is a part of a csv file 7,1265,76548,"0102:04" 8,1266,76545,"0112:04" I need to make the output data should look like this and the output data will be part of text file: 7|1265000 |7654899 |A| 8|12660000 |76545999 |B| The logic behind the... (6 Replies)
Discussion started by: RJG
6 Replies

2. UNIX for Dummies Questions & Answers

Shell script to read lines in a text file and filter user data Shell Programming and Scripting

sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies

3. Shell Programming and Scripting

Display the First and Last name from a file using shell scripting

I am new to shell scripting and doing a similar thing @ work Stan:Smith:Detroit:MI Jim:Jones:Farmington Hills:MI Jack:Frost:Denver:CO Sue:Apple:New York:NY Cindy:Thompson:Battle Creek:MI John:Smith:Denver:CO George:Jones:New York:NY Need to create a shell script This script will display... (1 Reply)
Discussion started by: jakemathew
1 Replies

4. Shell Programming and Scripting

To check the file permissions using python scripting

Hi, For a particular set of files, am trying to check if they are writable. i.e., checking whether they are having permissions greater than 755. Am able to check this using the statement: "if (os.path.isfile(FILE_PATH) and (os.stat(FILE_PATH).st_mode & 0777) == 0777):" But the problem... (1 Reply)
Discussion started by: arjun_arippa
1 Replies

5. Programming

To check the file permissions using python scripting

Hi, For a particular set of files, am trying to check if they are writable. i.e., checking whether they are having permissions greater than 755. Am able to check this using the statement: "if (os.path.isfile(FILE_PATH) and (os.stat(FILE_PATH).st_mode & 0777) == 0777):" But the problem here... (0 Replies)
Discussion started by: arjun_arippa
0 Replies

6. Homework & Coursework Questions

Shell scripting/working with a file

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: 1. Write a shell script that will work with a file from the command line. The program should: a. Check... (4 Replies)
Discussion started by: Jagst3r21
4 Replies

7. Shell Programming and Scripting

Shell scripting - need to arrange the columns from multiple file into a single file

Hi friends please help me on below, i have 5 files like below file1 is x 10 y 20 z 15 file2 is x 100 z 245 file3 is y 78 z 23 file4 is x 100 (3 Replies)
Discussion started by: siva kumar
3 Replies

8. Shell Programming and Scripting

Need to create file from shell scripting

Hi, I want to create a file from a shell script. the data for the file will come from variables. that is the file format is like, var1-value var2_value ... that is, var1_value should be placed in first 10 spaces and var2_value should be placed in next 8 columns like that. is there... (4 Replies)
Discussion started by: smr_rashmy
4 Replies

9. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies

10. UNIX for Dummies Questions & Answers

file activity (open/closed) file descriptor info using KORN shell scripting

I am trying to find a way to check the current status of a file. Such as some cron job processes are dependent on the completion of others. if a file is currently being accessed / modified or simply open state I will wait until it is done being processed before attempting the next process on that... (3 Replies)
Discussion started by: Gary Dunn
3 Replies

Featured Tech Videos