For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > August 2005 > grep









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author grep
Beginner

2005-08-27, 7:56 am

abc=`grep ELF $remove`

In a sh script i need to chek if $remove contains ELF and store it in a
varible for later use but can get it to work. I have tried above and slit
variations no success

HELP!!!!!!! :-)


Pascal Bourguignon

2005-08-27, 6:58 pm

"Beginner" <invaild> writes:

> abc=`grep ELF $remove`
>
> In a sh script i need to chek if $remove contains ELF and store it in a
> varible for later use but can get it to work. I have tried above and slit
> variations no success


What do you need to store in the variable?
ELF?
The lineS containing ELF?
A flag indicating ELF is present in the file or not?
The name of the file that contains ELF?


--
"A TRUE Klingon warrior does not comment his code!"
Beginner

2005-08-27, 6:58 pm


"Pascal Bourguignon" <spam@mouse-potato.com> wrote in message
news:87ll2ne452.fsf@thalassa.informatimago.com...
> "Beginner" <invaild> writes:
>
slit[color=darkred]
>
> What do you need to store in the variable?
> ELF?
> The lineS containing ELF?
> A flag indicating ELF is present in the file or not?
> The name of the file that contains ELF?
>
>
> --
> "A TRUE Klingon warrior does not comment his code!"


Sorry "ELF" the first three char in an executable file


Pascal Bourguignon

2005-08-27, 9:58 pm

"Beginner" <invaild> writes:

> "Pascal Bourguignon" <spam@mouse-potato.com> wrote in message
> news:87ll2ne452.fsf@thalassa.informatimago.com...
> slit
> Sorry "ELF" the first three char in an executable file


You're not sorry enough. I know that elf files contain ELF. So what?
A lot of other files contain ELF too!

--
__Pascal Bourguignon__ http://www.informatimago.com/
In deep sleep hear sound,
Cat vomit hairball somewhere.
Will find in morning.
Bill Marcum

2005-08-28, 7:57 am

On Sat, 27 Aug 2005 22:50:44 +1000, Beginner
<invaild> wrote:
> abc=`grep ELF $remove`
>
> In a sh script i need to chek if $remove contains ELF and store it in a
> varible for later use but can get it to work. I have tried above and slit
> variations no success
>
> HELP!!!!!!! :-)
>

Does $remove contain a filename or the actual text that you want to
check? What do you get in the variable $abc?


--
Knowledge, sir, should be free to all!
-- Harry Mudd, "I, Mudd", stardate 4513.3
Saju

2005-08-28, 6:57 pm



Beginner wrote:
> "Pascal Bourguignon" <spam@mouse-potato.com> wrote in message
> news:87ll2ne452.fsf@thalassa.informatimago.com...
>
>
> slit
>
A TRUE Klingon warrior prefers core dumps over controlled exits.[color=darkred]
>
>
> Sorry "ELF" the first three char in an executable file


Are you trying to identify if a file is a ELF executable ?

Why not use the "file" utility ? (like .. $ file foo | grep ELF)

Also note that an ELF format file need not be an executable - it could
be a shared object or a CORE

regards
srp
--
black holes suck

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com