The tutorial is about how to use cat,sed and awk commands to display file contents . when we start with linux basic commands, we generally introduced with cat command to show file contents. But with the help of sed and awk command also, you can see the file contents. The output will be similar to […]
sed
Replace keyword with its filename without extension : bash script
Today in this example we will use bash script. The task is replace keyword with its filename without extension.To accomplish this task we will use bash script.In bash script we will use for loop and sed command .To elaborate this example,lets assume we have 4 files called file1.txt red.txt blue.txt roger.txt The above each file […]
convert space into new line using sed command
convert space into new line using sed command In this sed command trick we will learn how to convert space into new line.For more understanding we will take an example. In file called test we have written colour names with spaces.Now we will convert the space into new line. Syntax: sed ‘s/s/n/g’ file_name example is […]
Convert new line to space by using sed command
This is a one line sed command trick in which we will convert the new line into space. I have a file in which there is a words per line.Now here I want to remove all these lines and instead of this I would like to use spaces. For eg. I have a file called […]
sed: -e expression #1, char 24: Invalid range end
While working on sed command stricken with this, error : “sed: -e expression #1, char 24: Invalid range end “). To solve this problem, we have used sed and tr command. We made a bash script having expect command in it. We were passing variable value from my mysql database into the bash script. The […]
Recent Comments