Coding Mines
Machine Learning, Data Science, Data Structure, and Algorithmic Problems and their Solutions
Home
Machine Learning
Data Science
Algorithm Problems
Real Interviews
Useful Resources
Troubleshooting
Books
About me
Bash Find and Replace in a String
The following command replaces existing white space with the character "_" in the variable $var1 and assigns it to the variable $var2.
$var2=$(echo "$var1" | sed 's/ /_/g');
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment