Answers for "bash remove characters from end of every line"

2

bash remove characters from end of every line

# Basic syntax using sed:
sed 's/..$//' input_file
# Where:
#	- 's///' means 's/search_for/replace_with/'
#	- '.' means any character
#	- $ means end of the line
# Putting it together, this sed statement means: replace any two 
#	characters at the end of every line with nothing. 

# Note, adapt this for your needs by changing the search pattern. 
#	E.g., by adding more '.'s, changing the search pattern, etc
Posted by: Guest on October-04-2020

Code answers related to "bash remove characters from end of every line"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language