cp produces odd file name ending in "?"

Alex Maynard amaynard-vQ8rsROW2HJSpjfjxSPG1fd9D2ou9A/h at public.gmane.org
Sat Dec 16 00:00:33 UTC 2006


Hi All,

I'm getting confused by something that is probably fairly simple (just not
to me).

I am running the following simple script to copy files in bash:

cp -p ../simuvolk/simbtnew2.tst simuvolk/simbtnew2.tst #done
cp -p ../longhor.prg longhor.prg  #done
cp -p ../simuvolk/mcpower2.gra simuvolk/mcpower2.gra #done
cp -p ../simuvolk/mcsign2.prg simuvolk/mcsign2.prg  #done
cp -p ../simuvolk/simulm.gss simuvolk/simulm.gss #done
cp -p ../simuvolk/simuar.gss simuvolk/simuar.gss #done
cp -p ../simuvolk/simudatabreak.gss simuvolk/simudatabreak.gss #done
cp -p ../simuvolk/simumcbrk.gss simuvolk/simumcbrk.gss #done
cp -p  /home/wei/longhor/simuvolk/proc/stock.g simuvolk/proc/stock.g
cp -p /home/wei/longhor/simuvolk/proc/jab.prc simuvolk/proc/jab.prc
cp -p /share2/wei/pctile3a.prc share2/wei/pctile3a.prc
cp -p /home/wei/longhor/simuvolk/stock/campbell/LHREGHH.G simuvolk/stock/campbell/LHREGHH.G
cp -p ../simuvolk/stock/campbell/LHREGNW.G simuvolk/stock/campbell/LHREGNW.G
cp -p ../simuvolk/stock/campbell/hachh.g simuvolk/stock/campbell/hachh.g
cp -p ../simuvolk/stock/campbell/hacnw.g simuvolk/stock/campbell/hacnw.g
cp -p ../simuvolk/proc/cowork2.prc simuvolk/proc/cowork2.prc
#cp -p ../simuvolk/proc/mic1.g simuvolk/proc/mic1.g
cp -p ../simuvolk/proc/boundtest.prc simuvolk/proc/boundtest.prc
cp -p ../simuvolk/proc/fraction.asm simuvolk/proc/fraction.asm

The strange thing is a number of the files, such as
simuvolk/stock/campbell/LHREGHH.G end up having a "?"
at the end of the filename after they are copied.

When I use the tab to type the file name this "?" becomes
a "^M"

I can get rid of the "?" by hand using
mv LHREGHH.G^M LHREGHH.G^M

But when I try automating that adding the similar command:

mv simuvolk/stock/campbell/LHREGHH.G^M  simuvolk/stock/campbell/LHREGHH.G

it doesn't find the file.  Changing the "^M" to "?" doesn't help either.

I don't really understand where the "?" comes from in the first place or
how I can get rid of it systematically from the bash script.  Has anyone
had experience with this?  (I've never seen that before)

Alex

--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list