Jeffrey Holle | 20 Feb 01:00 2004
Picon
Picon

using grep with both -l and -n

I've actually got two questions about grep.

First, can the -l, which just prints the matching filenames, and -n, 
which includes the matched line number using the syntax 
"filename:lineno", be combined to affect.

What I find is that adding -n makes inclusion of -l a noop.

The reason I ask is I'm using grep to generate .gdbinit files.  the 
syntax that -n emits is right on, except for the extra stuff that is 
normally suppressed by -l.

The second question is there a way to defeat the default behavior of not 
including the filename when -n is used and only one file is included in 
the search?  In this case, it prints just the lineno.

-
To unsubscribe from this list: send the line "unsubscribe linux-console" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Mike Castle | 20 Feb 04:04 2004
Picon

Re: using grep with both -l and -n

On Thu, Feb 19, 2004 at 04:00:07PM -0800, Jeffrey Holle wrote:
> The reason I ask is I'm using grep to generate .gdbinit files.  the 
> syntax that -n emits is right on, except for the extra stuff that is 
> normally suppressed by -l.

Would this work for you:
awk '{print $1}'

> The second question is there a way to defeat the default behavior of not 
> including the filename when -n is used and only one file is included in 
> the search?  In this case, it prints just the lineno.

Add /dev/null to the list of files.

mrc
--

-- 
     Mike Castle      dalgoda <at> ix.netcom.com      www.netcom.com/~dalgoda/
    We are all of us living in the shadow of Manhattan.  -- Watchmen
fatal ("You are in a maze of twisty compiler features, all different"); -- gcc
-
To unsubscribe from this list: send the line "unsubscribe linux-console" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Sébastien Lefebvre | 23 Feb 09:56 2004
Picon

Software switch from /dev/tty1 to /dev/tty2

Hi !

Does anyone know how to switch from /dev/tty1 to /dev/tty2 with Bash ?
Here is my setup, this could give you other ideas for alternative 
solutions :

I boot using a full screen framebuffer on /dev/tty1
The "active" console is /dev/tty2 (which receives the boot logs).
Then, using /etc/init.d, I launch a script (as I defined CONSOLE and 
console to /dev/tty1 in lilo.conf, every output is still displayed on 
/dev/tty2).

Then, I could either :

-Display a message on /dev/tty1 (this requires to clear the framebuffer, 
how to do that ?)

or

-switch to console /dev/tty1 within my script.

Thanks  a lot for any idea,

Sébastien

-
To unsubscribe from this list: send the line "unsubscribe linux-console" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

(Continue reading)

Jan-Benedict Glaw | 23 Feb 15:26 2004
Picon

Re: Software switch from /dev/tty1 to /dev/tty2

On Mon, 2004-02-23 09:56:03 +0100, Sébastien Lefebvre <sebastien.lefebvre <at> free.fr>
wrote in message <c1cf73$db4$1 <at> sea.gmane.org>:
> Hi !
> 
> Does anyone know how to switch from /dev/tty1 to /dev/tty2 with Bash ?

$ man chvt

MfG, JBG

--

-- 
   Jan-Benedict Glaw       jbglaw <at> lug-owl.de    . +49-172-7608481
   "Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg
    fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!
   ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

Gmane