I thought that giving a semicolon in bash is the same as giving a new line, just combining multiple lines.
However, with alias sudo='sudo -i' in the .bashrc file, the below result doesn't seem to work as I expected:
USER@HOST:~:$ cat tmp-1.sh
#!/bin/bash
source ~/.bashrc; sudo env | grep PATH
USER@HOST:~:$ cat tmp-2.sh
#!/bin/bash
source ~/.bashrc
sudo env | grep PATH
USER@HOST:~:$ ./tmp-1.sh
PATH=/usr/bin:/bin:/usr/sbin:/sbin
USER@HOST:~:$ ./tmp-2.sh
PATH=/home1/client/bin:/usr/python-3.8.2-r2/bin:/usr/jdk64/jdk1.8.0_112/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/bin:/root/bin
What's the difference between these two?