Rename the file to unix to include the $ sign (i.e. java class file)

I have a java class file causing problems due to name length:

GroundTransportationProductType $ GroundTransportationOptions $ GroundTransportationProductOption $ GroundTransportationOptionProviderLinks $ ProviderLinks.class

I managed to get the file in a unix window (Solaris) under the file name shortend. my.class

How to rename my.class to the correct class name above?

Using mv and cp usually (i.e. does nothing for dollar signs) does not work. I googled and searched extensively, but can't find anything about how to create a file with the dollar name in it in unix.

Thanks,

Kenny

+4
source share
1 answer

$ is of particular importance in shells, so you need to somehow avoid it. A better option would be to use single quotes around your file names. A \ before the '$' sign will also work.

 mv my.class 'Long$File$Name.class' 

or

 mv my.class Long\$File\$Name.class 
+6
source

All Articles