Describes how to set up an SED environment in a gnu/linux system
Install using the Package Manager
In general, SED is provided by default in most Gnu/linux distributions. Use this command to determine whether it exists on your system. If not, then in Debian-based gnu/linux you can use the APT Package Manager as follows to install SED:
[root]# sudo apt-get
After installation, ensure that SED can be accessed from the command line.
[Root]#--versio
Executing the above code, you will get the following result:
sed (GNU sed) 4.2.2 Copyright (C) Free Software Foundation, Inc. License gplv3+: GNU GPL version 3 or later
Similarly, the Gnu/linux-based RPM installation sed, with the Yum Package Manager, looks like this:
[Root]#-y install sed
After installation, ensure that SED can be accessed from the command line.
[Root]#--version
Executing the above code, you will get the following result:
GNU sed version 4.2.1 Copyright (C) by Free Software Foundation, Inc. This was free software; See the source for copying conditions. There is NO warranty; Not even for merchantability or FITNESS for A particular PURPOSE, to the extent permitted by law. GNU sed home page:
Installing from source codeSince the GNU SED is part of the GNU program, its source code is free to download. We have seen how to install SED using the Package Manager. Now, learn how to install sed from source code.
The installation below applies to any Gnu/linux software, and most other free-to-use programs. Here are the installation steps:
1th Step-Download the source code from a real place. The command-line utility wget serves this purpose.
[root]# wget ftp://ftp.gnu.org/gnu/sed/sed-4.2.2.tar.bz2
2nd Step-Unzip and decompress the source code of the download.
[root]# tar xvf sed-4.2. 2.tar.
3rd Step-Change into directory and run configuration.
[root]#./
4th Step-Once successfully completed, the configuration generates the makefile file. Compile the source code and use the Make command.
[root]# make
5th Step-You can run a test suite to make sure that the build is clean. This is an optional step.
[root]#
6th Step-Finally, install the SED utility. Make sure that you have superuser privileges.
[root]#
We have successfully compiled and installed SED. By executing the SED command, verify the following:
[Root]#--version
Executing the above code, you will get the following result:
sed (GNU sed) 4.2.2 Copyright (C) Free Software Foundation, Inc. License gplv3+: GNU GPL version 3 or later
Sed tutorial (i) Installation configuration