Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please avoid some special characters in file names #524

Open
jfilak opened this issue Apr 13, 2023 · 5 comments
Open

please avoid some special characters in file names #524

jfilak opened this issue Apr 13, 2023 · 5 comments

Comments

@jfilak
Copy link

jfilak commented Apr 13, 2023

I know that the goal is to make it human readable but don't forget that we also want to write CI jobs where we have to use scripting.

Would it be possible to get rid of:

  • white spaces (requires escaping and often resolves into several paths but not dangerous)
  • () (sub-shell)
  • $ (variables)
  • ! (events)
  • | (pipes)
  • <> (output redirection)
  • & (run on background)
  • / (path delimiter on UNIX)
  • \ (path delimited on Windows)
  • ; (shell token)
  • ` (sub-shell)

Example of OK characters:

  • +
  • * (better to not use it because path globbing but still not dangerous for shell)
  • =
  • _
  • .
  • ~
  • @
  • :
  • , (better to no use it because confusing)
  • []
  • {}
@ulrichauer
Copy link

ulrichauer commented Apr 13, 2023

  • and . are also dangerous.
    We also have to avoid characters that are allowed in object names.
    BTW: I like the (brackets) to encode the slash around /namespaces/ :-)

@schneidermic0
Copy link
Contributor

@schneidermic0
Copy link
Contributor

Thank you @jfilak for your feedback. I understand your use case.

However, as of now, I think I tend to keep the brackets/parenthesis (()) for objects with namespaces, because it's the best readable alternativ from my point of view. We could use other characters for name spaces, but they might lead to issues in other scenarios.

In any case we need to avoid following characters (as also mentioned by @ulrichauer):

  • _ Is heavily used by ABAP object names (further characters I found in object names often are -, =)
  • We also shouldn't use *, . or :

@jfilak
Copy link
Author

jfilak commented May 11, 2023

Gentlemen, period . is one of the most commonly used character and it is super OK to use it in file name. Why do you think we should not use it?

The only problem with asterisk is that shell could match a glob pattern which in the worst case leads to an error from the shell. So the verdict would be it is OK but use it only if no other option.

I do not get why do you think colon : and underscore _ are dangerous characters?

The brackets () are super dangerous because shells tends to execute the contents in a sub-shell. If you really need to use brackets then use curly braces {} or squar braces () which does not cause problems in shells.

@ulrichauer
Copy link

ulrichauer commented May 11, 2023

I do not get why do you think colon : and underscore _ are dangerous characters?

@jfilak Of course : and _ are not dangerous. But they are widely used in object names, so they are not suited as substitute for the namespace delimiters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants