- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Scripting Challenge
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2000 12:47 PM
09-26-2000 12:47 PM
I considered using a 'lsr -la > $FILE' but I'm not sure how to grep for just the 8th and 9th character. If I use 'cut' it strips away the rest of the output of the lsr command which is needed.
The output needs to have the $PATH/$FILENAME and permissions for each file that is world read/write.
Any Ideas ?
T.I.A.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2000 01:05 PM
09-26-2000 01:05 PM
Re: Scripting Challenge
# ls -al|awk '{if (substr($1,8,2)=="rw") {print $0}}' > /tmp/results
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2000 02:40 PM
09-26-2000 02:40 PM
Re: Scripting Challenge
thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2000 03:27 PM
09-26-2000 03:27 PM
Re: Scripting Challenge
# ls -al|awk '{if(substr($1,8,1)=="r")||(substr($1,9,1)=="w") {print $0}}' > /tmp/results
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2000 04:05 PM
09-26-2000 04:05 PM
Re: Scripting Challenge
find //wherever -perm -o+w -o -perm -o+r
-exec ls -la {} ;
A little hard to read but it says "find in directory //wherever, files with permissions of "other" as writable OR files with permissions of "other" as readable - then perform an 'ls -ls' on each file found.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2000 04:06 PM
09-26-2000 04:06 PM
Re: Scripting Challenge
find //wherever -perm -o+w -o -perm -o+r
-exec ls -la {} ;
A little hard to read but it says "find in directory //wherever, files with permissions of "other" as writable OR files with permissions of "other" as readable - then perform an 'ls -ls' on each file found.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2000 04:07 PM
09-26-2000 04:07 PM
Re: Scripting Challenge
find /wherever -perm -o+w -o -perm -o+r
-exec ls -la {}\;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2000 04:08 AM
09-27-2000 04:08 AM
Re: Scripting Challenge
I get an awk syntax error on the second command line you provided.
awk: The statement cannot be correctly parsed. The source line is 1. syntax error The source is line 1.
Fred,
I keep getting "invalid mode o+W-o" or variants of that when adding spaces between them.
Thanks for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2000 04:15 AM
09-27-2000 04:15 AM
Re: Scripting Challenge
ls -al|awk '{ifi((substr($1,8,1)=="r")||(substr($1,9,1)=="w")) {print $0}}' > /tmp/results
federico
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2000 04:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2000 04:31 AM
09-27-2000 04:31 AM
Re: Scripting Challenge
That works! Thank you very much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2000 11:56 AM
09-27-2000 11:56 AM
Re: Scripting Challenge
find_/wherever_-perm_-o+w_-o_-perm_-o+r_-exec_ls_-al_{}_\;
Fred
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2000 10:06 PM
09-27-2000 10:06 PM
Re: Scripting Challenge
Run it as a user instead of root, so you dont get into any directories that a user cant read anyways.
If you just need filenames, drop the -exec