script command is used to record shell sessions.It is useful for documentation, capturing and replicating issues. Simplest Implementation: Now by default, output file is ‘typescript’. We can pass any other name for output file as below.$ script myscript.log Now myscript.log would contain the output.If we examine the contents of this file, we find exactly whatContinue reading “Record shell sessions”
Category Archives: bash
Shell Script to read csv file into Array
This is a shell script to read a csv file into array and display the contents. Using an array is preferred we can keep track of no. elements in a row.For example:echo ${row[@]} will display all the elements of array.echo ${#row[@]} will display the no. of elements in the array.Also to get the 2nd elementContinue reading “Shell Script to read csv file into Array”