The basic format is mysql (any mysql options) < sql_script_you_want_to_run.sql for mysql, and psql (any psql options) < sql_script_you_want_to_run.sql for postgresql.
As long as the script file is readable and executable, just type the name of the script and it will execute immediately. Otherwise, you can call the shell interpreter and have it run it immediately such as: bash ./thefile where ./thefile is the script you want to run. Or, substitute the shell interpreter you wish to use instead of bash, such as sh, ksh, tcsh, csh, etc.
By typing its name into the shell
A Unix shell can be obtained in Cygwin, a Unix compatibility layer used to compile Unix programs and run them on Windows. Microsoft also makes a shell known as "Windows PowerShell" which incorporates more Unix-like features than the standard command prompt.
If the shell script is readable and executable then to execute it just type the name of the shell script file. Otherwise, you can explicity call a shell interpreter to run the file as a shell script, i.e., ksh myfile
No, the shell needs both execute and read permissions to run the script.
Shell scripts are interpreted files that contain commands and logic sequences to do things. They are similar to programs in that they contain logic and sequencing, and call other programs to accomplish tasks. You use shell scripts to automate tasks in Unix, run tasks periodically, create repeatable tasks, etc.
Shell scripts are not compiled; they are interpreted (and therefore do not need to be compiled). Just type in the name of the shell script and any parameters it needs to execute.
The special line at the beginning of the script is only necessary if you want the script to be run by a certain command interpreter that is different from your logon shell or because you don't know what environment the user of the shell might be running in. It is a special comment line that looks like: #!/command-name such as: #!/usr/bin/ksh which causes the ksh interpreter to be used for the rest of the shell script.
#!/bin/sh PS -a
su substitute user.. and su is a unix command used to run the shell of another user without logging off..
On the off chance that the name of the binary / script is in uppercase, yes. But "ifconfig", "Ifconfig", and "IFCONFIG" are treated as three separate programs.
Unix has the following categories of users: Superuser - root account, can do anything on the system ordinary user - has no special privileges restricted user - is restricted in what they can do in the shell and programs they can run.