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

GET SWITCH_POSITION - NOT WORKING #635

Open
jdugat opened this issue Jun 12, 2023 · 2 comments
Open

GET SWITCH_POSITION - NOT WORKING #635

jdugat opened this issue Jun 12, 2023 · 2 comments

Comments

@jdugat
Copy link
Contributor

jdugat commented Jun 12, 2023

#!/bin/bash
######## INITIALIZATION ########
LED SETUP
GET SWITCH_POSITION
TEST = $SWITCH_POSITION
Q STRING "echo $SWITCH_POSITION"
Q STRING "echo $TEST"

nothing is returned for the variable SWITCH_POSITION

BashBunny bin directory:

root@bunny:/usr/local/bunny/bin# ls*

ATTACKMODE
Q
bunny_framework
sysfixtime
LED
QUACK
factory_reset_bunny
udisk

@brotai
Copy link

brotai commented Sep 24, 2023

Q STRING "echo $SWITCH_POSITION you won't be able to see the printed output unless your script opens a terminal to print on. I'm assuming you're trying to write the output to a file. In this case, you generally would have to specify where you would like the file saved, something like:

Q STRING "echo $SWITCH_POSITION > /root/udisk/loot/switch_pos.txt"

if no location is specified ("echo $SWITCH_POSITION > switch_pos.txt") then the text file will be created in "/" directory which is the top-level root directory. To access it, login to your bash bunnys' command line and type "cd /" then you'll find it there. You'll know you're in the root directory if you do "cd .." and you remain in the same dir.

@GrylledCheez
Copy link
Contributor

I know this is old, but no whitespace is allowed between the variable name, the equals sign, and the value in bash.

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

3 participants