Yes, it is possible. Put code like this in a file, say fix-dashes.sh (I am on Mac OS, but this should work on other Unices):
IFS=$(echo -en "\n\b")
trap 'IFS=$SAVEIFS' 0
for i in $@
echo Processing $i
case $i in
echo "'$i' has a dash"
destname=$(echo "$i" | sed 's/ -.*//')
echo mv "$i" $destname
mv "$i" $destname
bash fix-dash.sh */ will rename the directories as you specified. The slash is important so that you only get directory names, otherwise regular files with dashes will be affected.
`IFS contains the delimiters for the words and since your file names have spaces you need to adjust.
I like using the limited Regular expression mechanism of
case because it mimics the REs used by
bash on the command line. In this case, only names containing dashes will cause the rename to be executed.
sed command does the transformation, in this case, substituting everything after the first with the null string.