Jump to content

Launch a script which's name has spaces from CLI


Recommended Posts

Posted

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

Posted

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?

Posted (edited)

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
Posted

 

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
Posted

 

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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