Tagged Questions
3
votes
2answers
91 views
Make copies of a single directory to multiple directories with different names
I'm trying to replicate a single directory (with sub-directories) to a bunch of new directories based on a list. For example I can:
mkdir Fred Barney Thelma Louise Foo Bar
How would I copy a premade ...
2
votes
2answers
301 views
Am I using bash after this ordeal?
On Mountain Lion, host Coguaro, I login as user coconutpowder using bash:
Coguaro:~ coconutpowder$ echo $0
-bash
I need to run a command with elevated privileges so I try to su switch to root but ...
2
votes
3answers
2k views
How can I check if mysql is installed using a bash script?
I need to check if mysql is installed from within a bash script. What would be an efficient way of doing that? I thought I could do this:
if [ ! -f `which mysql` ] ; then
echo "foo"
fi
But I ...
3
votes
2answers
483 views
Fix or alternative for mktemp in OS X
I'm looking at a bash script someone else wrote that uses mktemp:
TEMP=`mktemp --directory`
However, this line does not work on my machine (OS X 10.6).
How would I fix this line so that it is ...
4
votes
3answers
195 views
Best way to work through / display a tree of images sorted by size
I've got a deep directory tree containing .PNG files. I'd like to find all the .PNG files in the directory, sort them in order of size from smallest to largest, and then display every 50th image.
...