Re: LS command returns hidden files on OS X Leopard server
Re: LS command returns hidden files on OS X Leopard server
- Subject: Re: LS command returns hidden files on OS X Leopard server
- From: Jim Skibbie <email@hidden>
- Date: Sat, 24 Oct 2009 15:07:49 -0500
- Thread-topic: LS command returns hidden files on OS X Leopard server
Title: Re: LS command returns hidden files on OS X Leopard server
Ed-
The issue indeed stems from the fact that the script is running from the root user which means ls by default runs as ls –A according to the man page:
-A List all entries except for . and ... Always set for the super-user.
Which, unfortunately, is not what I was looking for. So I found two workarounds, one of which Doug McNutt has already posted at the applescript user group:
- do shell script (“su regular_user_acct_name_here -c ls /”) <-- where su (switch user) changes you to a user other than root, then –c (command line) passes the ls / command.
- do shell script (“ls / | grep -v '^\\.'”) <-- regular ls with all invisibles, then grep –v (invert matching) which allows everything through except removes any file names that start with a . dot.
Thanks to all for the help.
Jim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden