I have been building a little script that add/removes mksysb images from my nim server.
Part of what it needs to do is resolve if a file (server.mksysb.date) is known as a NIM resource (server_mksysb_date). To do this I wrote the following bit of KSH code:
Code:
for i in 'ls ${DIR}/*.mksysb.*'
do
FILENAME='basename ${i}'
NIMNAME='echo ${FILENAME} | sed s/\./_/g'
"Do some nim bits....."
done
However my sed command did something I can explain but not what I expected...the $NIMNAME is changed into "_________" (an underscore for every character in the $FILENAME.
Is there a way to change just the . to a _ and not every char?