Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Linux Command Line and Shell Scripting Techniques

You're reading from   Linux Command Line and Shell Scripting Techniques Master practical aspects of the Linux command line and then use it as a part of the shell scripting process

Arrow left icon
Product type Paperback
Published in Mar 2022
Publisher Packt
ISBN-13 9781800205192
Length 552 pages
Edition 1st Edition
Tools
Arrow right icon
Authors (2):
Arrow left icon
Jasmin Redzepagic Jasmin Redzepagic
Author Profile Icon Jasmin Redzepagic
Jasmin Redzepagic
Vedran Dakic Vedran Dakic
Author Profile Icon Vedran Dakic
Vedran Dakic
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Chapter 1: Basics of Shell and Text Terminal 2. Chapter 2: Using Text Editors FREE CHAPTER 3. Chapter 3: Using Commands and Services for Process Management 4. Chapter 4: Using Shell to Configure and Troubleshoot a Network 5. Chapter 5: Using Commands for File, Directory, and Service Management 6. Chapter 6: Shell-Based Software Management 7. Chapter 7: Network-Based File Synchronization 8. Chapter 8: Using the Command Line to Find, Extract, and Manipulate Text Content 9. Chapter 9: An Introduction to Shell Scripting 10. Chapter 10: Using Loops 11. Chapter 11: Working with Variables 12. Chapter 12: Using Arguments and Functions 13. Chapter 13: Using Arrays 14. Chapter 14: Interacting with Shell Scripts 15. Chapter 15: Troubleshooting Shell Scripts 16. Chapter 16: Shell Script Examples for Server Management, Network Configuration, and Backups 17. Chapter 17: Advanced Shell Script Examples 18. Other Books You May Enjoy

Converting DOS text to Linux text and vice versa

This is a strange idea – you might have thought a .txt file is a .txt file, right? Wrong.

There are subtle differences between .txt file formats in DOS/Windows and Linux. Sometimes, those differences can make you mad in a matter of seconds. We've had our fair share of experiences of that – scripts not working as input files were prepared on Windows, not on Linux; different treatment of CSV files in Excel by design... sometimes it's just too funny when, after hours of deliberation, you realize that something as simple as a .txt file created on another OS can make such a mess. Let's explain what the problem is and work through it.

Getting ready

We just need one Ubuntu machine for this recipe. Let's say we are going to continue using cli1 to master these commands. Furthermore, we need to install one package, called dos2unix. So, if we are using cli1 (Ubuntu), we need to type in the following command...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image