Alt Text

Show parent replies

The post below is a reply to another user

nice it fits in a skeet if i rename variable x=$(xclip -o -selection clipboard) while [[ $x =~ "\n\n+" ]]; do x=${x//"\n\n+"/"\n"} done x=${x//-*\n} x=${x//"\n"/ } x=${x##* } x=${x%%* } while [[ $x =~ " +" ]]; do x=${x// +/ } done echo "$x" | head -c -1 | xclip -selection clipboard (told u im newb)
3 replies

fixed: x=$(xclip -sel clipboard -o) x=$(echo "$x" | tr -s '\n') x=$(echo "$x" | sed '/-$/N;s/-\n//') x=$(echo "$x" | tr '\n' ' ') x=$(echo "$x" | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') x=$(echo "$x" | tr -s ' ') echo -n "$x" | xclip -sel clipboard gemini trust broken, gpt is my new best friend
and since its just echo i can just not bother with a variable at all xclip -sel clipboard -o \ | tr -s '\n' \ | sed '/-$/N;s/-\n//' \ | tr '\n' ' ' \ | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' \ | tr -s ' ' \ | xclip -sel clipboard