Problem naming file with specific character

Hi,

I need help for a really specific problem, I need to create a file with the name "\*'fileName'*\" but i have two problems.

The first is, i don't succeed to set the ' (strong quote) close to the fileName like this : 'fileName' and the second part is when i do ( ls ) i get : '"\*fileName*\"' .

So i need to set the strong quote close to fileName and remove the strong quote at begin and end of the name when i use ls.

Thank you for your helps.

Hi

touch \\*\'fileName\'*\\
ls
'\*'\''fileName'\''*\'
ls -b
\\*'fileName'*\\
dir
\\*'fileName'*\\
compgen -f
\*'fileName'*\

The need to create such an oddly named file is a little concerning. You would later on have to read it in a similarly convoluted way and your backup process may not like it either.

Can you elaborate why you think you need to create it like that? Other servers may not accept it as a valid file at all, so that may cause you other problems.

It would be helpful to be accurate with the ICODE tags too. At the moment, I'm not sure if you want to include te double-quotes or not, or if it even needs a leading space. I'm not wanting to berate you, just trying to get an accurate request so we can work on a suitable solution (or negate the need altogether)

Kind regards,
Robin

nezabudka : Thank you for your solution, but your i don't succeed with it.

I need this for an exercise in a test

Sorry if this was not clear, i will give you the think i need :

i need to create a file with the name "\?$*'SiegFried'*$?\" (the double quote is needed in the name)

for be sure you suceed they test with :

$> ls -lRa *Frie*
-rwxr--r-- 1 XXX XXX 0 feb 20 07:31 "\?$*'SiegFried'*$?\"

Actually the best I get is :

$> ls -lRa *Frie*
-rwxr--r-- 1 XXX XXX 0 feb 20 07:31 '"\?$*SiegFried*$?\"' 

Thanks for advices !

You can try formatted output in the "find" and "stat" commands.
Also, the "-ls" option in the "find" command.
The name will be displayed without single quotes

--- Post updated at 01:05 ---

I found

ls -lRaN

In order to name a file with special characters, ecape each special character with a \
The \ is a special character itself.
For the string "\?$*' (6 charcters) you enter \"\\\?\$\*\' (12 characters).