• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: LS command returns hidden files on OS X Leopard server
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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:

  1. 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.
  2. 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

  • Prev by Date: Re: LS command returns hidden files on OS X Leopard server
  • Next by Date: Re: Ascii number of return inconsistency
  • Previous by thread: Re: LS command returns hidden files on OS X Leopard server
  • Next by thread: Re: Ascii number of return inconsistency
  • Index(es):
    • Date
    • Thread