repo.or.cz
/
scripts.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
first commit
[scripts.git]
/
addspace
blob
89f3653d5b1aafa0828f9631305c637a905ae30e
1
#!/bin/bash
2
3
progname
=
`basename
$0
`
4
5
if
[
$#
!=
1
]
6
then
7
echo
"Script replaces
\"
_
\"
and adds a space
\" \"
instead"
8
echo
"Usage:
$progname
\"
target file
\"
"
9
exit
1
10
fi
11
12
old_name
=
$1
13
dir
=
`dirname "
$1
"`
14
file
=
`basename "
$1
"`
15
16
new_file
=
`echo
$file
| sed "s/_/ /g"`
17
new_name
=
$dir
"/"
$new_file
18
19
if
[
"
$old_name
"
!=
"
$new_name
"
]
20
then
21
mv
"
$old_name
"
"
$new_name
"
22
fi
23
24
exit
0
25