![]() ![]() bashrc is a special bash script which is always located in your home directory. What is this file with all this crazy code in it? Type these two lines of code inside that file and click Save. Type the following command, and you should see the bash_script.sh file inside: dir Let’s create a new file named bash_script.sh. cd ~/catkin_ws/src/linux_course_files/move_bb8_pkg/scripts Pretty cool right? Software engineers are always looking for ways to automate tedious tasks! Then, when you want to run a set of commands, all you have to do is run the bash script (which contains the commands that you want to execute). Bash scripts are text files that can contain commands that we would normally type out manually in the Linux terminal. Examples of the commands we have used so far include cd (to change directories), ls (to list the folders and files inside a directory), and mv (to move a folder or file from one place to another), etc.įortunately, Linux has something called bash scripts. Up until now, when we wanted to run commands in Linux, we opened up a terminal window and typed the command manually and then ran it. Return to Table of Contents Create a Bash Script You get this ugly message about not being able to find the executable. Try executing the hello_world.py file now, and see what you get: rosrun rosrun move_bb8_pkg hello_world.py Notice how no users, including the owner, have execute privileges on the hello_world.py file. All other users have only read privileges (r–).Owner has read and write privileges (i.e.Everything is in order, reading from left to right: Given this information above, let’s translate the line of hello_world.py containing -rw-r–r–. All Users: This permission group includes the rest of the users.Group: Whatever group the file or directory was assigned to.There are also three different user permission groups: This means that the user can execute the file. This means that the user can write or modify the file or directory. This means that the user can read the file or directory. Linux has three permission types for files and directories: In the beginning of the line, you see the following: -rw-r-r. You should see a hierarchy of all the folders underneath the catkin_ws folder. folder) structure of the catkin_ws folder, the workspace folder for ROS. You have ROS running on Ubuntu Linux (I’m running my Ubuntu Linux inside a virtual machine on Windows 10). ![]() Understand Secure Shell (SSH Protocol) in Linux.By the end of this tutorial, you will have the rock-solid confidence to move around in Linux with ease. This tutorial has a lot of steps, but be patient and take your time as you work all the way through it. Everything else, you can look it up when you need it. Don’t waste your time memorizing a bunch of commands you may never use instead focus on learning the fundamentals, the handful of commands and tools that you will use most frequently. I’m a firm believer in the Pareto Principle (also known as the 80/20 rule). While there are hundreds of Linux commands, there are really only a handful that you will use repeatedly. In this tutorial, you will learn the most common commands and tools you will use again and again as you work with ROS on Linuxfor your robotics projects. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |