Piping
Piping is reading input from one command and serving to another command. Now let’s Combine all of these commands and solve our problem. Suppose, we have a text file name of the file name.txt
Example:
$ cat names.txt Ahmedabad Taj Mahal India Gate Qutub Minar
So we can change these strings to base64 encoding in following way:-
cat names.txt | while read names do; echo $names | base64 ; done
Output:
Convert Text File Strings into Base64 encoding
In the Linux system, you have a command base64. This helps you to convert text into base64 encoding but how can you change multiple lines of text into base64 encoding. We will understand some common Linux command in this article. That helps us to solve our problems. We will discuss piping, echo, and how to get user input from the keyboard.
Example: