answersLogoWhite

0


Best Answer

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.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you read from file in unix shell script?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a shell script which deletes all line containing the word unix in the filesn suppiled as argument to this shell script?

# 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


What file extensions are used to identify command shell scripts?

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.


How do you write shell scripting in UNIX?

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.


What is the procedure of execute a script in shell in ubantu?

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.


How do you change permissions on a shell script in unix?

Use the 'chmod' command to change permissions on any file. Note: you have to be the owner (or the superuser) to do this.


How do you create a shell in unix?

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.


What are the two c shell script files that are automatically executed when logging into a unix system when your default login shell is set to the c shell?

The local user files that are read are the .login and the .cshrc files


How can you protect zip file with password with the help of UNIX script?

A Unix script is not necessary. The zip utility has the capability of compressing the files with a password.


Which command in unix is used to run the script immediately?

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.


What is the purpose of profile in unix?

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.


Record your login session into a file in UNIX?

Use the 'script' command; it captures everything you are doing and stores it into a file.


What job functions could you script in a UNIX or DOS shell script?

Actually, just about anything you want to do. Depends on the job function requirements.