Find out the name of a folder...

hammer32

Registered
Howdy,

I've got a script that I've been running under cygwin on a Win98 machine. Now that I've corrected that error :) I'm trying to get it to run under OS X.
It is supposed to look in a directory of folders with numbers as names and find the name of the lowest numbered folder:

flrng=`dir /sw/backup/files --format=single | head -n 1`

This works in cygwin, but flrng ends up without value when I drop this on the Terminal window.

Thanks for any help!
:)
 
You need to make sure you are using the right kind of unix shell for that script. In your Cygwin setup, what was the shell you wrote the script for?

By default, the terminal in Mac OS X uses the tcsh shell, though it also ships with sh, bash, ksh and csh.

If that doesn't work out, you'll need to look for more specific differences between Cygwin's setup, and the setup of files on the Mac.
 
Back
Top