Posts

Paste Command in Linux with Examples

Image
Tamizh Tech Tutorial Paste Command in Linux  (Linux Commands) Linux for Beginners Paste Command in Linux (5 Examples) This tutorial provides 5 practical examples of paste command in linux / unix OS. Paste Command  This command is mainly used to merge the file contents horizontally  This command is also used to display the single file contents. Operations Merging Files Horizontally Merging Files Horizontally with delimiter option Merging Files Sequentially Displaying File Contents using Paste Reading and Displaying Data in Paste Command 1. Merging Files Horizontally Be default, the paste command is used to merge the two or more number of files horizontally (parallelly) with tab delimiter Here, lines of the files are merged horizontally Syntax p aste file1 file2 … file n Example Here files like f1.txt, f2.txt and f3.txt are merged horizontally with tab delimiter by default using paste command. 2. Merging Files Horizontally with delimiter option Be default, files are merg...

String Handling in C++

Image
  C++ Strings String It is a set of characters (group of characters) arranged in sequential memory location In c/c++, there is no specific built-in data type point to string type  We can perform various operations on strings such as Comparing Joining Reversing Indexing and many more, etc,...  C++ supports two types of strings. They are C Style String (Character Array) String Class. 1. C STYLE STRING In c style string, the string is group of characters terminated with null character It will be created either character array or character pointer Example 1 – String Declaration      char name[50]; Example 2 – String Definition      char name[]=”Hello”; Here, the array name will hold the values “Hello” with additional null character \0 which is automatically added by the compiler (unlike c) Memory Representation      I. EXAMPLE OF C STYLE STRING 1. SOURCE CODE #include <iostream> using namespace std; int ...

For Loop in Bash Script (Shell Scripting)

Image
Tamizh Tech Tutorial For Loop in Bash Script  (Shell Script) Shell Scripting Tutorial For Loop It is an example of looping statement and alternative for while loop It is used to execute group of statements based on the looping condition Bash supports several examples of for-loops. Some of them below Simple for loop Range based for loop C Style based for loop Infinite for loop. 1. Simple for loop (Data based for loop) Here the loop is based on the data or collection. The data can be the same type or different type. Syntax f or variable in data do # code done Where, variable is an user defined variable. Example 1 - Data based for loop Source Code echo "--------------------------------" echo -e "\t Data based For Loop" echo "--------------------------------" for i in 12 true "Hello" 34.55 do     echo " $i" done Output 2. Range Based for loop Here the loop is based on the three attributes like start, stop and interval . These a...