본문 바로가기

Linux

How to use shell script

반응형

Example 1


#! /bin/bash


# $ sudo chmod +x gps_init.sh

# $ ./gps_init.sh


echo ">> print usb port info ... "

dmesg | grep tty

echo " ---------------------------- "

echo ">> insert com port number :"

read comport

echo ">> assign permission to use /dev/ttyUSB${comport}"

sudo chmod 777 /dev/ttyUSB${comport}

echo ">> run advanced_navigation_driver_node"

gnome-terminal --command "rosrun advanced_navigation_driver advanced_navigation_driver /dev/ttyUSB${comport} 1000000"



Example 2

#! /bin/bash

# $ sudo chmod +x usb_cam_init.sh
# $ ./usb_cam_init.sh

echo ">> run usb_cam ... "
echo ">> use \usb_cam\image_raw "
rosrun usb_cam usb_cam_node