"ls" not working and Finder displaying only partial list of files

On a PowerMac G5 2.5GHz with 10.3.9 client installed, I've come across a problem where, when trying to list the files in ~/Library/Fonts (i.e., the user's fonts folder, not the system-wide font folder) using the Unix "ls" command, it merely hangs for a short while (around 10 seconds) and then returns to the prompt without listing any files whatsoever. And using the Finder to do the same thing in the same folder only shows a partial list of the font files (no font files listed beyond those beginning with the letter "F"). This only occurs when trying to display the contents of the above directory--there is no problem listing the contents of any other directory using either "ls" in Terminal or the Finder, not even the /Library/Fonts directory. I am logged into that user's account as that user (he's a standard user) and not the admin user. This is a standard installation and there are no third-party installations (i.e., /usr/local doesn't exist; nor /opt). I have already deleted .DS_Store in ~/Library/Fonts and have rebooted the machine afterwards to no avail. Any ideas would be appreciated.

The code is now very expensive! but thats the result of avoiding the cd command. Right? Is there a max length for the ls and other commands? a limit of 128KB?
Mac OS X command line length limit is 256 kilobytes
Btw
done < <(ls -1 -d $myPath 2>&1)
Gives me, a known error. Happens a lot for me.
syntax error near unexpected token <
done < <(ls -1d $myPath 2>&1)
Are you using the bash shell? This is a bash shell feature. Does your script begin with
#!/bin/bash
So I did try to use a pipe
(ls -1d $__myPath 2>&1) | while read file
do
__filesArr[$index]="${file}"
#echo "filesArr$index ="${__filesArr[$index]}
index=$((index+1))
done
if [ -z "${__filesArr[*]}" ]; then # removed the 0 test, was never called.
echo "${__ErrHeader}Error - No files found" 1>&2
return
fi
But then, of course, I lose my variable (scope) outside the while loop
The while loop runs in a sub-shell, so when the while loop finishes, the filesArr disappears along with the sub-shell.
The < space <(...) notation in bash allows the while loop to run in the current shell, so filesArr will be visible after the loop finishes.
<div class="jive-quote">Anyway came up with,
done <<<"$(ls -1d $__myPath 2>&-)"
and that works, but why isn't your line working? Any idea?
The <<<word is a form of the "HERE DOCUMENTS". According to "man bash", the 'word' is expanded and supplied to the command on its standard input.
I have not played with <<<word with respect to spaces in file paths. If this works, then it would be similar to the < space <(...) for this example. But I did test < space <(...) to make sure spaces were preserved. You get to test <<<word for proper space handling.
<div class="jive-quote">Also why
(ls -1d $__myPath 2>&1)
instead of
(ls -1d $__myPath 2>&-)
Because 2>&1 comes from when I first learn shell scripting back in '85, so I'm more comfortable with it.
The last avoid/catch an error message when there are no matching files.
As always, thanks for your helpfull knowledge!

Similar Messages

  • Dear Sirs,when i use the computer updating my iphone to ios 7.1,suddenly black out.The computer has no power and my iphone does not work and keep display the screen that connect to itunes. so when i connect my iphone to iTunes, it says"itunes has detected

    Dear Sirs,when i use the computer updating my iphone to ios 7.1,suddenly black out.The computer has no power and my iphone does not work and keep display the screen saying the iphone need to connect to itunes. So when i connect my iphone to iTunes, the computer says"itunes has detected an iphone in recovery mode. you must restore this iphone before it can be used with itunes"
    So my question is if I click OK(restore the iphone),will i lose all my data and whatsapp??
    Thank you for your help and time.
    Regards,
    hopeless

    If you didn't back up the phone to iCloud or iTunes (on your computer) BEFORE attempting the update, the data will be lost.

  • Sound not working. Alsamixer displays only one bar (Master),

    Hi all,
    I have used archlinux for some time, but since I've upgraded my desktop computer, it has me puzzled.
    My specs:
    lspci:
    00:00.0 Host bridge: Intel Corporation 4 Series Chipset DRAM Controller (rev 03)
    00:01.0 PCI bridge: Intel Corporation 4 Series Chipset PCI Express Root Port (rev 03)
    00:1a.0 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #4
    00:1a.1 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #5
    00:1a.2 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #6
    00:1a.7 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #2
    00:1b.0 Audio device: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller
    00:1c.0 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 1
    00:1c.4 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 5
    00:1c.5 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 6
    00:1d.0 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #1
    00:1d.1 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #2
    00:1d.2 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #3
    00:1d.7 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #1
    00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 90)
    00:1f.0 ISA bridge: Intel Corporation 82801JIB (ICH10) LPC Interface Controller
    00:1f.2 IDE interface: Intel Corporation 82801JI (ICH10 Family) 4 port SATA IDE Controller
    00:1f.3 SMBus: Intel Corporation 82801JI (ICH10 Family) SMBus Controller
    00:1f.5 IDE interface: Intel Corporation 82801JI (ICH10 Family) 2 port SATA IDE Controller
    01:00.0 VGA compatible controller: nVidia Corporation G80 [GeForce GTX 260] (rev a1)
    02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)
    03:00.0 IDE interface: Marvell Technology Group Ltd. 88SE6101 single-port PATA133 interface (rev b2)
    05:02.0 Multimedia controller: Philips Semiconductors SAA7134/SAA7135HL Video Broadcast Decoder (rev 01)
    It loads this modules for sound:
    MODULES=(snd-mixer-oss snd-pcm-oss snd-hwdep snd-page-alloc snd-pcm snd-timer snd snd-pcsp snd-hda-intel soundcore)
    All seems well. However, when I load alsamixer, I only see one bar (Master). It is not muted, but when I use aplay, or any other media program... no sound.
    Based on suggestions found using the forumsearch and google, I have run alsaconf. as root, I do have sound in windows, and when I try a player that displays sound processing, like xmms does, there seems to bee something happening.
    My mainboard is Asus P5QL, with VIA chipset for sound.
    Any help would be greatly appreciated!
    Last edited by psyflash (2008-12-23 21:22:24)

    The reason ubuntu showed only 1 master is because it uses the pulseaudio output plugin. Uninstalling or disabling pulseaudio makes alsamixer behave as normal. However, you can simply achieve the same effect by telling alsamixer to use your card specifically, which is usually card 0. ie
    alsamixer -c 0
    This will work when pulseaudio is installed, and may have worked in your case. If anyone else has the same problem and doesn' want to move to oss4 yet, try that. If it works, add 'alsamixer' as an alias to that in ~/.bashrc so you dont need to remember the -c 0 part.

  • I have an image sequence in JPG and when I select open image sequence, select all does not work and I can only highlight one frame at a time.  I want to import these frames into QT7 to make a time lapse clip.  Any suggestions

    I have an image sequence in JPG that I want to import into quitck time 7 for making a time lapse clip.   It has an option to open the image sequence, but when I do, it only lets me highlight one frame at a time.  The select all option seems to do nothing when I click on it trying to highlight all the frames. 
          If QT7 is not designed to perform this function, is there another alternative?   iMovie is non intuitive for this kind of operation and I cannot find a clear tutorial for using it to make time lapse clips from a sequence of still frames.  
           The tutorials Ive found on YouTube are well intended, but they all seem to leave out a vital step that eludes detection.  
      Anyway, any help appreciated. 
    Thanks
       I am new to this forum and I'm not sure I can locate this thread again once I'm out of it.
    <Email Edited by Host>

      Yes, I tried that.   The files were ordered by their original numbers as imported from the camera, but I batched them through Phocoshop to downsize all of them into a more manageable file size.   I opened that destination folder from quick time  from where it said select image sequence.   I clicked on the first one and opened it.   The result was a large image with an arrow indicating a movie was ready to go.   When I pressed the arrow, though, I realized it had only imported that one frame so there was no movie.   The files are Jpgs and are about 450 KB each. 
        To your knowledge are there any links to iMovie tutorials or quick time tutorials that may address this situation?  Maybe there will be one I haven't looked at yet. 
        Thanks

  • My print setup will not work and Fire fox only prints blank pages. Help?

    I tried to change the margins on my printer set up. Since I did this my printer will only print blank pages from Firefox. (If I open a PDF it prints fine) I have tried to go into print set up but it only comes up as a big black page. Any thoughts??

    Sorry, just to be clear:
    (1) Which did you use to make the change and which do not display correctly:
    orange Firefox button > Print > Page Setup<br>
    ''or''<br>
    classic File menu > Page Setup, or
    the Properties button in the Print dialog?
    (2) If you switch to a different printer, such as a PDF printer driver (many free ones you can install, such as [http://www.primopdf.com/ PrimoPDF] and [http://www.cutepdf.com/products/cutepdf/writer.asp CutePDF Writer]), can you regain access to Firefox's Page Setup dialog?

  • Reader 11.0.10 errors to "not responding" and seems to only partially load for my main user account.

    I am running Windows 7 OS.  I created a new user and it runs Reader fine so it is not a corrupted copy of Reader.  I have gone through my services list and made a couple changes with no solution.  I Started in diagnostic mode but still had the problem.  I have uninstalled Reader and re-installed several times.  I have uninstalled and run RegHunter to remove any registry problems and then re-booted and re-installed with no effect.  How can this be corrected?

    Please don't post the same question multiple times!

  • PL/SQL not reading data in display only field

    I'm using apex 4.0.
    I've found on several occasions where a process did not work because a display only field is not relaying it's information. The item itself displays the information, but if I add another text field and set the new item equal to the original in the "bad" PLSQL code, nothing will display (new text field will display other fields' info). If I switch the errant display only field to a text field, everything will start working properly and continue doing so when I switch it back to display only. Even stranger is the same PLSQL code makes use of other display only items and that portion continues to work.
    Is this a weird bug? Is there something I'm missing that I can do differently (besides leaving it as a text field)?

    I just figured it out. For some reason, "save session state" was set to no. Hopefully this will save someone else much heartache.

  • When I unplug Apple headphones from my MacBook Pro sond from internal speakers not work, and system soud preferences displayed: Output: optical digital out port only

    When I unplug Apple headphones from my MacBook Pro sond from internal speakers not work, and system soud preferences displayed: Output: optical digital out port only

    If you see a red light in the audio output port, then the internal switch is stuck.  Insert the earphone plug a few times and see if you can trip the switch.  If that fails, insert a cocktail stirrer and the like and jiggle it around inside.  If that fails, take it to an Apple store and have the technicians at the genius bar do it for you.
    Ciao.

  • My Ipad 2 external speakers does not work and headphones has popping sound. This all occured at the same time as my Iphone and Ipod headphones only played mono (no, the "mono" option is not on). How can there be audio issue for all these devices?

    My IPad 2 external speaker does not work and the original headphones have popping sound when used. This all occurred at the same time as my IPhone and IPod headphones only plays mono (and no, the "mono" option is not on) with the original headphones, as well as, other headphones tested.  How can there be audio issue for all these devices at the same time?
    As you may have noted from the list of Apple devices I own, I believed in the Apple and the products it was producing; but it is hard to believe from my experience and the other voices within the Apple Community that we are all experiencing the same hardware issues. Especially since I recently, I upgraded to an IPhone 4g (no, my faith in IPhone 5 series is very little) and is experiencing the same audio problem as described above. So now, I am off to the Apple store again to be told that it’s a hardware problem on new IPhone. Really? Apple, what happen to the pride in the product you were producing?

    Everyone does things a little differently. I love to "jam " along with iTunes ( or old Lp's) . Always have. That's where/how I've learned to play .
    I'm sure leonieDF is giving a proper way to jam along on a keyboard with an iTune. He blows my mind all the time with what he knows. Nuff respects to him !
    What I do is make a GB project I call "Jam With". I'll make several new tracks that are blank. Just has a few instruments named in the blank tracks. You can change those per song ...
    Because I'm not concerned about changing the pitch / key.... of the iTune or the tempo ... I can simply play along with it.
    Peace,
    P. Dreadie

  • HT1386 my Ipod will not connect to my computer it worked yesterday but not today and it is only a new ipod touch, it will not even be recognised on my itunes but yet it can charge off my computer. need help!

    it worked yesterday but not today and it is only a new ipod touch, it will not even be recognised on my itunes but yet it can charge off my computer. need help!

    iOS: Device not recognized in iTunes for Mac OS X
    or
    iOS: Device not recognized in iTunes for Windows

  • Hi - I created a form in Adobe Livecycle and have a button on it to send the form via email.  the button did not work and i looked online and saw where you could change it to a regular button and enter the email for it to go.  it worked, but only for thos

    Hi - I created a form in Adobe Livecycle and have a button on it to send the form via email.  the button did not work and i looked online and saw where you could change it to a regular button and enter the email for it to go.  it worked, but only for those with adobe pro.  i could not get it to work with reader.  is there a way i can make it work for reader?

    Noted.
    The LiveCycle user to user forum is across town at:
    Adobe LiveCycle 
    Be well...

  • I have a macbook pro from 2006, my internal cd drive is not working and i'm trying to install factory definitions from an external cd drive. the problem is that when i press c nothing happens only appears an interrogation folder.

    i have a macbook pro from 2006, my internal cd drive is not working and i'm trying to install factory definitions from an external cd drive. the problem is that when i press c nothing happens only appears an interrogation folder. or sometimes appears the apple logo and than back again to the interrogation folder... Help please!!!!

    mcbsousa wrote:
    hm... Is there any chance of making the bootable usb file and send it by dropbox or something like that? than put it in a pen drive and connect to the mac??
    Sending by Dropbox where, To who, to what computer? As your does not start up.
    You need to take at least the OS disc to a work Mac computer and create DMG from the OS install disc then restore that DMG to USB thumb drive. Then you can boot the computer from that thumb drive and install the OS. That is if your hard drive is functioning correctly.
    Then you can use the App disc in the external CD/DVD drive to load up all the included Applications that come with your version of OS X.

  • I was using my iphone 4s and then the app started to not work and then my phone blocked and then when i go on home most of my apps disappeared including my settings so i cant restore with out disabling find my iphone on settings

    I was using my iphone 4s and then the app started to not work and then my phone blocked and then when i go on home most of my apps disappeared including my settings so i cant restore with out disabling find my iphone on settings please help me asap thankyou so much

    Log in to icloud.com on a web browser with your Apple ID and disable FMiP there.

  • I use classical Hebrew for my work, and Pages will only display English characters even with a Hebrew font selected. If I cut and paste Hebrew characters from another document, as long as the font is supported, it will appear in Pages.  If I type it won't

    I use classical Hebrew for my work, and Pages will only display English characters even with a Hebrew font selected. If I cut and paste Hebrew characters from another document, as long as the font is supported, it will appear in Pages.  If I type it won't continue in Hebrew.  I have tried downloading several fonts, including those from professional societies, but the only way to get Hebrew in my document is to cut and paste.  Does anyone know how to fix this?  I use an older MacBook running OS 10.9.1.  I used to do my Hebrew work in Word, but it is no longer supported by Mac OS.

    Just clarifying:
    Pages '09 has bad support for Hebrew, Arabic etc but will accept pasted text.
    Pages 5 has much better support but with bugs.
    If you have columns they are in the wrong order ie Text starts in the left column and ends in the right column.
    If you type English into Hebrew text it tends to fall in the wrong position eg instead of to the left of Hebrew punctuation it goes to the right.
    As Tom recommends the only real solution on the Mac is Mellel.
    Peter
    btw Tell Apple, they are amazingly slow to fix this running sore which has been broken since RtoL was supposedly introduced in OSX 10.2.3 over a decade ago.
    Peter

  • My Siri and microphone in other apps hasn't been working lately. I've cleaned the mics, took off te case, and it's still not working. My camera only picks up audio when it's off of vibrate. And now I can't answer texts with the new pull down thing.

    My Siri and microphone in other apps hasn't been working lately. I've cleaned the mics, took off te case, and it's still not working. My camera only picks up audio when it's off of vibrate. And now I can't answer texts with the new pull down thing. please help

    Hello Sarahd200037,
    Thanks for using Apple Support Communities.
    To troubleshoot the microphone on your iPhone please follow the steps in the article linked to below.
    iPhone: Microphone issues
    Take care,
    Alex H.

Maybe you are looking for

  • I have replaced my old Mac Mini with new one.  What should I do about my Time Capsule?

    With the old Mac Mini (2009 model) I used Time Machine and a Time Capsule to back up everything on the Mac Mini itself and on external hard drive I added when I needed more storage space.  I've replaced the old Mac Mini with a 2011 model, and migrate

  • PL/SQL gateway in runtime

    All, I created an application in DEV environment (Apex 3.2.0, Oracle 10g, XP, localhost, Language: de). I imported it into Prod environment (APEX RUNTIME, PL/SQL Gateway, Oracle 11g, Linux) and enabled it. When I try to access my application via http

  • Video Playback is screwed up in Premiere since attempting Blu-Ray

    I am completely at my wits end. I have been using Premiere for years with very little problems that I could not fix myself until now. My system had CS2 and CS4 loaded and working fine...no problems. Any video I either captured and/or imported played

  • Recover database with corrupt datafile

    I have an Oracle 9.2.0.6.0 database which has crashed due to disk failure & there is no backup. on the disk that failed there is one rollback datafile so I was hoping to be able to just drop this datafile & the related tablespace & recreate on disk t

  • Black Screen when trying to play iTunes Movies PLEASE HELP

    This is my set up. I have an iMac running OS X (10.5) and a mac mini running (10.6) this mac mini is hooked up to my tv in the living room, it also is fitted with an external hard drive (this is where my itunes media folder is located for my mac mini