running different nodes from a shell script
I have different nodes from different packages and I want to run it from a single shell script. The description is given below:
I have 3 different packages and each package contains 3 different nodes
(sample directory structure)
package_name1
|— src
|— node1_node.cpp
|— CMakeLists.txt
|— package.xml
package_name2
|— src
|— node2_node.cpp
|— CMakeLists.txt
|— package.xml
package_name3
|— src
|— node3_node.cpp
|— CMakeLists.txt
|— package.xml
Each package has 1 executable. Every time I have to go to each executable path and execute. Instead of that I want to write a single script which will run the 3 different executable from 3 packages.
Is there a way to do that?
I tried by running the script:
cd path_to_package_name1/devel/lib/package_name1
./node1_node
cd path_to_package_name2/devel/lib/package_name2
./node2_node
cd path_to_package_name3/devel/lib/package_name3
./node3_node
But it is executing only the first node.How can I execute the 3 nodes together?