Suppose in a program a line is there:
what will happen if i write a command:
The issue is that scripts run in a private subshell, and therefore don't affect the shell that called them.
If we pretend that we have a script like this:
#!/bin/bash # Name: test_script export OOGA=echo 'ooga' export BOOGA=echo 'booga'
Then we can add it to the current shell by using the source command:
Thanks to kupendra for this tip on the forum.
- Export command in shell script?
- Launch and run commands from shell script - How-To - Shell
- Launch and run the commands from shell script ✓ - Forum - Linux/Unix
- Linux change password command line script - How-To - Bash
- Export the Result of a Ping Command to a Text File - How-To - Windows
- Shell script to telnet and run commands ✓ - Forum - Linux/Unix