We use echo command to display the line. Once you have created an empty shell script with the above command, add the following lines to it. If you want to pass the filepath via command line argument, replace the second line of your script as.
Please note, if your file contains backslash then the above code will treat it as escape character. If you want to omit backslash escape, then you need to use -r option with read command in your while loop, as shown below.
In this article, we have learnt different ways to read file line by line shell script. Reading files is a very common requirement in Linux and can be used in many bigger scripts. In the above code, the while loop goes through the file. We use echo command to display the line. Once you have created an empty shell script with the above command, add the following lines to it.
If you want to pass the filepath via command line argument, replace the second line of your script as. Please note, if your file contains backslash then the above code will treat it as escape character.
If you want to omit backslash escape, then you need to use -r option with read command in your while loop, as shown below. In this article, we have learnt different ways to read file line by line shell script. Shell Script to Load data into the database using a. Since i'm new to scripting i'm findind it difficult to code a script. The script has to be an executable with 2 paramters passed to it. The Parameters are 1.
The Control file name. The Data file name. RedHat Commands. OpenSolaris Commands. Linux Commands. SunOS Commands. FreeBSD Commands. Full Man Repository. Advanced Search. Contact Us. Forum Rules. Mark Forums Read. Thread Tools. View Public Profile for pallavishetty.
0コメント