-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathspaces
executable file
·26 lines (22 loc) · 872 Bytes
/
spaces
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
#--------------------------------------------------------------------------
# $Id: spaces.sh,v 1.3 2005/02/22 12:31:08 ggorjan Exp $
#--------------------------------------------------------------------------
# Change spaces in file or map names with the underscore character, i.e., _
#--------------------------------------------------------------------------
# Needed: /
#--------------------------------------------------------------------------
# Nothing to configure below!
#--------------------------------------------------------------------------
NAME=$(basename $0)
USAGE="$NAME"
for FILE in *; do
TMP=`echo "$FILE" | grep '\ '`
if [ -n "$TMP" ]; then
echo $FILE
mv "$FILE" `echo "$FILE" | sed 's/\ /_/g'`
fi
done
exit 0
#--------------------------------------------------------------------------
# spaces.sh ends here