Here is the way to start another script in shell script. The purposes is entire logic you can keep at one place, and it is easy for maintenance.
You May Also Like | UNIX: How to Use Sed and AWK Commands
The project is to convert US dollar into Indian rupee (assuming 1 USD = 70 INR.). Here are two scripts for this purpose.
- conversion.sh
- display_currency.sh
Start another script in shell script
I’ve added conversion logic in this script. And I’ve passed the output to called script.

I’ve initialized value conv_factor=70. For calculation, I used the let command. The output I’ve saved to converted_rupees.
I’ve used the export command to pass value to called script, which I used for display. The way I showed here simplifies calling a script from another script. So it is easy to maintain them.
Here’s the output of scripts
In this video, you can see the execution of both scripts.
Summary
- You can call a script from another script
- Use let command to calculate math related things (computation)
- Export command
-
How to Count and Print Blank Spaces in Python
Two Python methods that show you how to count blank spaces in a text file
You must be logged in to post a comment.