954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Printing file access permission....

hi, i have just started with scripting and read several tutorials. But i have some doubts,

1) How do i print the file access permission(FAP),... not changing the FAP... but printing it ??

2) how to search for duplicate files in current directory ?

3) how do i validate a blank user input ? like if user doesnt enter any values and presses Enter, what condition do i put in an If construct ?

4) how to check what files were created today ?

thnx for reading the post.

livingsword
Newbie Poster
18 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 

Well it all depends on what way you want to go about it?

Will you use the windows script host?
A batchfile?

jbennet
Moderator
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
 
Well it all depends on what way you want to go about it? Will you use the windows script host? A batchfile?



i want to script for bash shell.

livingsword
Newbie Poster
18 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 

oh ok sorry, didnt look at the title properly :)

#!/bin/bash
echo "what info do you want"
read
ls -l $REPLY > /tmp/ls
cat /tmp/ls | awk '{print $1 $9}'


Will show the permissions on each file in the specifified dir. I think you can modify it for your pourpouse.

jbennet
Moderator
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You