Jump to content

Launch a script which's name has spaces from CLI


Butters

Recommended Posts

Hey, the title says it all.

 

I am familiar with launching OSbot from CLI so this is only about the -script part

 

Let's say I have a local script called "My Script". 

How to launch it in Windows/Linux? I've tried noob stuff like

without commas -script My Script:null

with commas -script "My Script:null"

name with commas, params nor -script "My Script":nulll

 

Nothing works

Link to comment
Share on other sites

It works great on Windows. Failed to launch it on Linux, any ideas?

 

 

 

Super easy for my own scripts. Problem when I want to launch a script that someone else made. And I find decompiling it unethical biggrin.png

 

What Abuse said should work as well. I use the syntax I gave above on Linux though atm, no idea why it won't work. Which shell are you using?

Link to comment
Share on other sites

What Abuse said should work as well. I use the syntax I gave above on Linux though atm, no idea why it won't work. Which shell are you using?

 

Sorry for misleading you. Yep, both your and Abuses' options work fine. The problem is that I want to store the script params in a variable and then add it to the java -jar line. For example this works fine:

java -jar "osbot 2.4.101.jar" $OSBOTLOGIN $BOT1 -script My\ Script:null $BOT1WORLD

Though this doesn't find the script

SCRIPT="-script My\ Script:null"
java -jar "osbot 2.4.101.jar" $OSBOTLOGIN $BOT1 $SCRIPT $BOT1WORLD

By the way, a noob question. What does the "\" actually do? And even so, how to understand this syntax that you've provided?

"\"My Script\":null"
Edited by nosepicker
Link to comment
Share on other sites

 

Sorry for misleading you. Yep, both your and Abuses' options work fine. The problem is that I want to store the script params in a variable and then add it to the java -jar line. For example this works fine:

java -jar "osbot 2.4.101.jar" $OSBOTLOGIN $BOT1 -script My\ Script:null $BOT1WORLD

Though this doesn't find the script

SCRIPT="-script My\ Script:null"
java -jar "osbot 2.4.101.jar" $OSBOTLOGIN $BOT1 $SCRIPT $BOT1WORLD

By the way, a noob question. What does the "\" actually do? And even so, how to understand this syntax that you've provided?

"\"My Script\":null"

 

It's bad practice in general to store parameter options in a variable

 

Try this:

SCRIPT="My\\ Script:null"
java -jar "osbot 2.4.101.jar" $OSBOTLOGIN $BOT1 -script $SCRIPT $BOT1WORLD

or 

SCRIPT="My\ Script:null"
java -jar "osbot 2.4.101.jar" $OSBOTLOGIN $BOT1 -script $SCRIPT $BOT1WORLD
Link to comment
Share on other sites

 

It's bad practice in general to store parameter options in a variable

 

Try this:

SCRIPT="My\\ Script:null"
java -jar "osbot 2.4.101.jar" $OSBOTLOGIN $BOT1 -script $SCRIPT $BOT1WORLD

or 

SCRIPT="My\ Script:null"
java -jar "osbot 2.4.101.jar" $OSBOTLOGIN $BOT1 -script $SCRIPT $BOT1WORLD

 

Thanks, 

tried this and it didn't work 

SCRIPT="My\ Script:null"
java -jar "osbot 2.4.101.jar" $OSBOTLOGIN $BOT1 -script $SCRIPT $BOT1WORLD

Gonna try with two \\ when I get on my other PC.

The idea behind this is to launch like 10 bots with the same script, so thought that storing script params to variables would make it cleaner and easier  to manage

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...