문제

I'm using alot readlink command, and what I'm trying to do is to create a short cut for this. I've added this to ~/.bashrc

rl() { readlink -f "$1" | xclip -i -selection clipboard; }

But when I want to paste it by pressing ctrl+v , terminal is trying to execute a command. Which is not what I want, I suspect it because there is a newline character at the end.

So the question is how to make this command copy to the clipboard and make the cursor stay at the the same line when pasting it?

도움이 되었습니까?

해결책

Just found an answer:

   -n, --no-newline
          do not output the trailing newline
rl() { readlink -fn "$1" | xclip -i -selection clipboard; }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top