You will have to be more specific about what you intend to do. In general, a shell script by itself does not read file information and then do something with it. There may be calls to other scripting languages such as awk, perl, python, etc., that will actually read the information and process the data.
# SS29 # Script to delete all lines containing the word 'unix' from files supplied as arguments # Usage: SS29 file1 file2 file3 ... if [$# -lt 2] then echo Insufficient arguments exit fi for file do grep -v unix $file>/temp/$file cp /temp/$file $file done
For windows, you might use .cmd, .bat as common file extensions. Unix doesn't use file extensions as associations, so no file extension needs to be used in the Unix environment. A shell script in Unix is simply a text file with any name that is readable and executable. However, file extensions are typically used in Unix as a documentation aid that states that the file is a shell script. Common extensions are .sh, .csh, .ksh, .tcsh, .zsh, etc.
A shell script is nothing more than a readable and executable ASCII text file. In this file you put all of the commands that you want to execute, in sequence. The name of the file can be anything you like. Any text editor (VI, VIM, pico, etc) can create a shell script file In addition, shell script files have the ability to detect logic, and are programmable. Just think about what tasks you want to perform and their order, and put it into a file, and there you have a shell script.
For any Unix or Linux based operating system, make the text file readable and executable and then invoke (call) it by the file name, which will execute the script.
Use the 'chmod' command to change permissions on any file. Note: you have to be the owner (or the superuser) to do this.
If you are asking about a shell script, just create a text file with the commands you want to execute inside it. Then, make the file executable and readable and you have a shell script file. A shell program is more complicated; you need to support the user features that most users would expect a shell program or shell interpreter to do. I would suggest studying the source code of a current shell program to see how to go about implementing one of your own.
The local user files that are read are the .login and the .cshrc files
A Unix script is not necessary. The zip utility has the capability of compressing the files with a password.
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.
The .profile file is used to put any settings or changes to the login shell environment when you log in. This file is only read once during login.
Use the 'script' command; it captures everything you are doing and stores it into a file.
Actually, just about anything you want to do. Depends on the job function requirements.