LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   grep: Trailing backslash (https://www.linuxquestions.org/questions/linux-software-2/grep-trailing-backslash-606443/)

fakie_flip 12-12-2007 11:49 PM

grep: Trailing backslash
 
Why does this happen? I get it once in a while when I try to do tab completion.

rkelsen 12-13-2007 03:51 AM

Normally, you would use a trailing backslash at the end of each line of a really long command. It sorta forces the cursor to "CF" to the next line.

Alternatively, the backslash can be used as an escape character.

What is the command that causes your problem?

archtoad6 12-16-2007 10:05 AM

Ahh, not to be rude, but why does what happen? -- Did part of your post get lost?

fakie_flip 12-16-2007 12:35 PM

What happens is what is in my thread topic. I'll explain more. Whenever I use tab completion with certain commands, I get the message "grep: Trailing backslash". I don't remember what command it was that caused it to happen, but it has happened several times. Then I cannot complete the command, and I have to start over without using tab completion. Is there any way I can still use tab completion? What is CF. I was thinking carriage return, but that can't be right? I googled http://www.google.com/search?q=defin...ient=firefox-a and none of those definitions seem correct for the meaning that you meant.

archtoad6 12-16-2007 06:45 PM

Quote:

Originally Posted by rkelsen (Post 2989175)
It sorta forces the cursor to "CF" to the next line.

Yeah, what is "CF"? (I do understand folding a logical line into 2 physical ones -- you're actually escaping the new-line -- but I don't understand the acronym.)


fakie_flip
What is the command that causes your problem? I assume it's to do w/ tab completion of the options for a particular command. For instance: In MEPIS, "apt-get i<tab>" magically becomes "apt-get install " (including the 2nd space).

I have never seen the "grep: Trailing backslash" error msg., but if you'll give an actual example, I'd like to try to duplicate your problem.

BTW, the controlling file (all 833 lines in MEPIS 6.0) is /etc/bash_completion, the problem may lie there.

rkelsen 12-16-2007 07:31 PM

Quote:

Originally Posted by archtoad6 (Post 2992654)
Yeah, what is "CF"? (I do understand folding a logical line into 2 physical ones -- you're actually escaping the new-line -- but I don't understand the acronym.)

It was probably a bad choice of phrase. I meant it as "carriage return".

Your description (folding a logical line into two physical ones) is way better than mine was. I haven't been getting much sleep lately because we have a newborn, so please forgive me. ;)

JZL240I-U 12-17-2007 03:45 AM

Quote:

Originally Posted by rkelsen (Post 2992690)
It was probably a bad choice of phrase. I meant it as "carriage return".

That is also known by "CR", so I'd surmise you blended "CR" and "LF" (carriage return and line feed) ;).

Quote:

Originally Posted by rkelsen (Post 2992690)
...we have a newborn...

All the best wishes for your family then and in particular for the youngest member :D.

rkelsen 12-17-2007 05:27 AM

Quote:

Originally Posted by JZL240I-U (Post 2993098)
That is also known by "CR", so I'd surmise you blended "CR" and "LF" (carriage return and line feed) ;).

You're probably right. :)
Quote:

Originally Posted by JZL240I-U (Post 2993098)
All the best wishes for your family then and in particular for the youngest member :D.

Thanks mate. She's our first. This lack of sleep business is taking a bit of getting used to, but her smile is makes it all worthwhile!

And now back to the topic at hand:

fakie_flip: I've found out that in order for grep to give that message, the \ has to be escaped first, eg: \\. I dunno if that helps, but it's something... ;)

archtoad6 12-17-2007 07:22 AM

rkelsen,
Let me "pile on" w/ congratulations & sympathy for the sleep deprivation. :) :) :)
(Mine, i.e. my 1st, is expecting her 4th.)


& back on topic:
Quote:

fakie_flip: I've found out that in order for grep to give that message, the \ has to be escaped first, eg: \\.
Just to be crystal clear, would that escaping be in /etc/bash_completion?

JZL240I-U 12-17-2007 09:17 AM

Quote:

Originally Posted by archtoad6 (Post 2993298)
...(Mine, i.e. my 1st, is expecting her 4th.)...

So you are going to become grandfather again by your first daughter's forth child? Or is it the forth child of your first wife? :p :D ;)

My children are now 8 and 6 and the problems changed ;).


All times are GMT -5. The time now is 01:42 AM.