Make It Runnable
By default, your Mac won't let you run a script as a command. You need to give it permission.
1
Make the script executable:
chmod +x ~/myinfo.sh
2
Run it:
~/myinfo.sh
What's chmod +x? chmod changes file permissions. +x adds "execute" permission, letting you run it as a command.
Key Takeaway
chmod +x script.sh makes a script executable. Then run it with ./script.sh or the full path.