I have the following bash script in Linux Ubuntu which opens a new terminal with multiple tabs and in each tab it executes ssh
command to access a remote router:
#!/bin/bash
gnome-terminal --tab -e "ssh root@172.16.17.4" --tab -e "ssh root@172.16.17.5"
In the bashrc file, I have included the definition of the following alias commands:
alias router4='ssh root@172.16.17.4'
alias router5='ssh root@172.16.17.5'
When I replace the full ssh
command in the first script with these alias commands, each Tab gives me the following error:
There was an error creating the child process for this terminal
Failed to execute child process "router6" (No such file or directory)
How to solve this problem?
Note: When I execute the previous alias commands in a maually opened tab, they work perfectly.