[Gambas-user] Problem with Shell Gambas 3.10.0
Shannon Kuchler
shannon at inflecto.org
Thu Apr 19 20:32:01 CEST 2018
The exec works unless there are spaces in the directory name the in instead of downloading to "my dir" it downloads to "my" which makes me think I need to in close it like this 'my dir' but steamcmd gives me an error same director does not exist unable to write to desk
On April 19, 2018 1:13:54 PM CDT, Tobias Boege <taboege at gmail.com> wrote:
>On Thu, 19 Apr 2018, Shannon Kuchler wrote:
>> This is the Shell command I'm trying to run
>>
>>
>>
>> p1 = Shell "steamcmd +login" & " " & UserName & " " & PassWD & " " &
>"+force_install_dir" & " " & CacheSaveLocation & "/" & dlDat[1] & " " &
>"+app_update 251570 -beta" & " " & dlDat[1] & " " & "+quit" Wait For
>Input As "Process"
>>
>>
>>
>> in console it should look like this
>>
>> steamcmd +login username password +force_install_dir dirname/dirname
>+app_update 251570 -beta dirname +quit
>>
>>
>>
>> The problem is on most systems the shell command works just fine but
>on one system with a fresh install of arch linux i get this error
>>
>> /bin/sh: +force_install_dir: command not found
>>
>>
>>
>>
>> it like it's skipping everything up to +force_install_dir in the
>command does anyone know why?
>>
>>
>
>I have no explanation for this.
>
>>
>> I can get it to work like this but CacheDir is a directory with
>spaces same thing for dlDat1 it has spaces as well so that's not
>working either
>>
>> p1 = Exec ["steamcmd", "+login", UserName, PassWD,
>"+force_install_dir", CacheDir, "+app_update", "251570", "-beta",
>dlDat1, "+quit"] For Input As "Process"
>>
>
>And this is very weird. Exec should extra-work. In fact, you shouldn't
>be
>using the Shell instruction because you don't need any shell features
>like
>redirection. Exec is:
>
> o faster (you don't need to spawn and initialise a shell process,
> which has to parse your commandline),
> o less complicated (you don't have to quote anything), and
> o more secure (your above code is vulnerable to command injection
> via any of the variables you use).
>
>(If you do need shell features, I would recommend using the Shell$()
>quoting
>function instead of quoting with double quotes by yourself. Subst$()
>can be
>used to make your commandline clearer, in addition.)
>
>I very much doubt that the problem is with /bin/sh, and spaces in
>filenames
>are perfectly fine. It's mostly the shell which gives you a headache
>with
>spaces because space happens to be a control character in the shell
>language.
>This isn't necessary with Exec at all. It passes its argument array
>directly
>to the process.
>
>How does the Exec line "not work either"? Are you sure that "+login"
>expects
>UserName and PassWD in separate arguments? Some page I found [1] says
>that
>you only specify the username. I suppose it will ask you interactively
>for
>the password (which is sensible). But you'll know that better.
>
>Regards,
>Tobi
>
>[1] https://developer.valvesoftware.com/wiki/SteamCMD#Linux.2FOS_X
>
>--
>"There's an old saying: Don't change anything... ever!" -- Mr. Monk
>
>--------------------------------------------------
>
>This is the Gambas Mailing List:
>https://lists.gambas-basic.org/listinfo/user
>
>Search the list:
>https://lists.gambas-basic.org/cgi-bin/search.cgi
>
>Hosted by https://www.hostsharing.net
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20180419/ea262b81/attachment-0001.html>
More information about the User
mailing list