K
K
Konkase2015-02-27 16:02:38
bash
Konkase, 2015-02-27 16:02:38

How to remove the end of line character from the beginning of a line?

Good afternoon!
Original line:

[email protected]:# sed 's/\t/:/g' /tmp/list | cut -f6 -d: | sort -u | grep QQ
QQ 7 96559

When you try to add something to the end of a line, the first character in the line is replaced. How to fix?
[email protected]:# sed 's/\t/:/g' /tmp/list | cut -f6 -d: | sort -u | sed 's/$/1/'
1Q 7 96559

It is normally added to the beginning.
[email protected]:# sed 's/\t/:/g' /tmp/list | cut -f6 -d: | sort -u | sed 's/^/1/'
1QQ 7 96559

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konkase, 2015-02-27
@Konkase

Happened:
sed 's/.$//'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question