Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • ion ion
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 84
    • Issues 84
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • redox-os
  • ionion
  • Issues
  • #948
Closed
Open
Created Apr 01, 2020 by matu3ba@matu3baMaintainer

Multiline strings suggestion. Escaping allows newline to be overwritten and somehow all following lines.

Take

echo "a\"            # THIS IS FALSE, but does not break immediately and corrupts later lets
echo "a\"\""
echo "\$"
#echo "a"
#echo "a\\"""
#echo "a\\\"         # THIS IS FALSE, but does not break immediately and corrupts later lets

Then the output is

a"            # THIS IS FALSE, but does not break immediately and corrupts later lets
echo a""
echo $
#echo a
#echo a\
#echo a\

However the user would likely expect "a\" to fail. This does not look very safe to me to allow.

Multiline strings should have a special syntax, since the user likely intends to write only the current line.

My complete test for escaping, which in the let broke the shell was

echo "a"
echo "a\\"""
echo "a\\\"         # THIS IS FALSE, but does not break immediately and corrupts later lets
echo "a\\\\"
echo "a\\\\\"       # THIS IS FALSE, but does not break immediately and corrupts later lets
echo "a\\\\\\"
echo "\\t"
echo "t1\tt2"
echo "\\n"
echo "\n"
let fa = FALSE
let ri = RIGHT
let testvar = "\\foobar"
echo "\$fa"
echo "\\$ri"
echo "\$(cmd args...)"
echo "\@(cmd args...)"
echo "\[ hello array \]"

and the expected output (which I ran as single line in another shell):

a"
a""
ion: syntax error: unterminated double quote
a\\
ion: syntax error: unterminated double quote
a\\\
\t
t1\tt2
\n
$fa
\RIGHT
$(cmd args...)
@(cmd args...)
\[ hello array \]
Edited Apr 01, 2020 by matu3ba
Assignee
Assign to
Time tracking