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

Script arguments get split on spaces, passed as multiple arguments #57

Open
spiffytech opened this issue Oct 9, 2015 · 0 comments
Open

Comments

@spiffytech
Copy link

If an argument passed to my script contains spaces, even if the argument is quoted, my script receives each space-separated segment as a separate argument.

Ordinarily I would backslash-escape the spaces, but I'm running this self-contained .run file from an installer tool that doesn't give me that option.

Please update makerun to support script arguments with spaces, so I can e.g., pass in file paths with spaces in them and actually use makerun in my installer :)

I expect it's as simple as wrapping each argument in quotes inside $SCRIPTARGS?

/tmp/mkselftest 11:29:46 spiffytech@spiffywork _

$ cat src/echotest.sh 
#!/bin/bash

echo $1
echo $2
echo $3
echo $4


/tmp/mkselftest 11:29:49 spiffytech@spiffywork _

$ makeself-2.2.0/makeself.sh src test.run "Multi-arg test" './echotest.sh'                                                                                                                                                                    
Header is 498 lines long

WARNING: Overwriting existing file: test.run
About to compress 8 KB of data...
Adding files to archive named "test.run"...
./
./echotest.sh
CRC: 1342037018
MD5: 974773a52a5dc2a1614ef9ba8a80eeef

Self-extractable archive "test.run" successfully created.


/tmp/mkselftest 11:29:59 spiffytech@spiffywork _

$ ./test.run One "Two Args" Three                                     
Verifying archive integrity... All good.
Uncompressing Multi-arg test  100%  
One
Two
Args
Three


/tmp/mkselftest 11:32:01 spiffytech@spiffywork _

$ ./src/echotest.sh One "Two Args" Three
One
Two Args
Three
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

1 participant