I have no idea what we are doing here. Did I miss a lesson? I have already searched and found one other question about this but that confused me even more.
" For instance, let’s have a look at the script you used in this first demo, called demo.sh . I will just tell you the location of the script. It’s in the following path: /home/simulations/public_sim_ws/src/all/ros_basics_examples/linux_demo/ .
The rest you should be able to do by yourself at this point." Why would I be able to do this when we haven’t learned it?
There is no demo script in this lesson, that pathway is not in this lesson. I am completely lost.
“” Create a bash script that does the following:
It will receive one parameter, which will contain either:
If the parameter is circle, the script will execute the move_bb8_circle.py file.
If the parameter is forward_backward, the script will execute the move_bb8_forward_backward.py file.
If the parameter is square, the script will execute the move_bb8_square.py file.“”
I tried this and was able to get this to print enter circle, forward etc… But when I entered circle it just gave me an error.
Can someone please help me. Thank you. Jason
user:~/catkin_ws/src/linux_course_files/move_bb8_pkg/my_scripts$ ./thebash.sh Please enter one of the following; circle forward_backward square user:~/catkin_ws/src/linux_course_files/move_bb8_pkg/my_scripts$ circle bash: circle: command not found user:~/catkin_ws/src/linux_course_files/move_bb8_pkg/my_scripts$
here is the possible content of thebash.sh script.
echo "Please enter one of the following: circle, forward, backward, square"
echo "Example: ./thebash.sh circle"
if [[ "$argument" == "circle" ]]; then
echo "Well done, you typed CIRCLE"
elif [[ "$argument" == "square" ]]; then
echo "Well done, you typed SQUARE"
echo "Oh, you typed something else: $argument"
If you paste this content in a file ending with the .sh extension (example: test.sh), and then give it execute permissions with chmod +x test.sh, and run it with ./test.sh, it will tell you that the correct way of running would be: