Reply
Thread Tools
Posts: 13 | Thanked: 6 times | Joined on May 2008 @ RVA
#21
Which should be a number one not a letter i -- I don't recall ever typing an i

do you mean in "tail"?

edit: I AM DUMB! I see it now!

Last edited by Serafin; 2011-09-18 at 01:28.
 

The Following User Says Thank You to Serafin For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#22
Just copy and paste if you can.


rootsh grep -A 13 lock_code /dev/mtd1 | tail -1
 

The Following User Says Thank You to Addison For This Useful Post:
Posts: 13 | Thanked: 6 times | Joined on May 2008 @ RVA
#23
Originally Posted by Addison View Post
Just copy and paste if you can.


rootsh grep -A 13 lock_code /dev/mtd1 | tail -1
Ok. I did that. Its response was:

" grep: invalid number 'lock_code' "
 
danramos's Avatar
Posts: 4,672 | Thanked: 5,455 times | Joined on Jul 2008 @ Springfield, MA, USA
#24
Originally Posted by Serafin View Post
Ok. I did that. Its response was:

" grep: invalid number 'lock_code' "
I think you may have left out the 13 after the -A flag
__________________
Nokia's slogan shouldn't be the pedo-palmgrabbing image with the slogan, "Connecting People"... It should be one hand open pleadingly with another hand giving the middle finger and the more apt slogan, "Potential Unrealized." --DR
 

The Following User Says Thank You to danramos For This Useful Post:
Posts: 13 | Thanked: 6 times | Joined on May 2008 @ RVA
#25
WE DID IT! Thanks guys! You all were amazing. Much appreciated!
 

The Following User Says Thank You to Serafin For This Useful Post:
danramos's Avatar
Posts: 4,672 | Thanked: 5,455 times | Joined on Jul 2008 @ Springfield, MA, USA
#26
Originally Posted by Addison View Post
rootsh grep -A 13 lock_code /dev/mtd1 | tail -1
Just do you understand each part...

rootsh is telling the system to run the following as the root user (i.e. full control)
grep is a command that looks for expressions and prints them (literally: g/re/p ...get.. regular expression.. and print)
-A 13 is a flag telling grep to match something and also print the next 13 lines after whatever matches
lock_code is literally the phrase (the expression) we're looking for
/dev/mtd1 is the filename we're going to search through (in this case, a filehandle for Memory Technology Device subsystem number one in Linux)
| is a pipe that takes the output from the commands on the left and feeds it as input to the commands on the right
tail is a command that prints the last few lines of input
-1 is a flag telling the tail command to just print one line (the last line only)

I figured it might help to understand what it's doing to help get the command right.
__________________
Nokia's slogan shouldn't be the pedo-palmgrabbing image with the slogan, "Connecting People"... It should be one hand open pleadingly with another hand giving the middle finger and the more apt slogan, "Potential Unrealized." --DR
 

The Following 2 Users Say Thank You to danramos For This Useful Post:
danramos's Avatar
Posts: 4,672 | Thanked: 5,455 times | Joined on Jul 2008 @ Springfield, MA, USA
#27
Originally Posted by Serafin View Post
WE DID IT! Thanks guys! You all were amazing. Much appreciated!
Ah--I spent time typing my last entry and didn't see yours. Cheers, man! Glad we could help where Nokia clearly wouldn't. heh
__________________
Nokia's slogan shouldn't be the pedo-palmgrabbing image with the slogan, "Connecting People"... It should be one hand open pleadingly with another hand giving the middle finger and the more apt slogan, "Potential Unrealized." --DR
 
Posts: 13 | Thanked: 6 times | Joined on May 2008 @ RVA
#28
Originally Posted by danramos View Post
Just do you understand each part...

rootsh is telling the system to run the following as the root user (i.e. full control)
grep is a command that looks for expressions and prints them (literally: g/re/p ...get.. regular expression.. and print)
-A 13 is a flag telling grep to match something and also print the next 13 lines after whatever matches
lock_code is literally the phrase (the expression) we're looking for
/dev/mtd1 is the filename we're going to search through (in this case, a filehandle for Memory Technology Device subsystem number one in Linux)
| is a pipe that takes the output from the commands on the left and feeds it as input to the commands on the right
tail is a command that prints the last few lines of input
-1 is a flag telling the tail command to just print one line (the last line only)

I figured it might help to understand what it's doing to help get the command right.
that actually makes sense. Thanks so much everyone! I hope this thread helps someone else too.
 

The Following User Says Thank You to Serafin For This Useful Post:
danramos's Avatar
Posts: 4,672 | Thanked: 5,455 times | Joined on Jul 2008 @ Springfield, MA, USA
#29
Originally Posted by danramos View Post
Just do you understand each part...

rootsh is telling the system to run the following as the root user (i.e. full control)
grep is a command that looks for expressions and prints them (literally: g/re/p ...get.. regular expression.. and print)
-A 13 is a flag telling grep to match something and also print the next 13 lines after whatever matches
lock_code is literally the phrase (the expression) we're looking for
/dev/mtd1 is the filename we're going to search through (in this case, a filehandle for Memory Technology Device subsystem number one in Linux)
| is a pipe that takes the output from the commands on the left and feeds it as input to the commands on the right
tail is a command that prints the last few lines of input
-1 is a flag telling the tail command to just print one line (the last line only)

I figured it might help to understand what it's doing to help get the command right.
One correction... the g in grep stands for 'globally match'... but 'get' made better sense as an explanation. Just couldn't help correcting it.

Take care!
__________________
Nokia's slogan shouldn't be the pedo-palmgrabbing image with the slogan, "Connecting People"... It should be one hand open pleadingly with another hand giving the middle finger and the more apt slogan, "Potential Unrealized." --DR
 
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#30
Originally Posted by danramos View Post
One correction... the g in grep stands for 'globally match'...
It does, but strictly speaking isn't - g/re/p comes straight from ed(1)[1], and ed's g command accepts an address range (even though it defaults to the entire file). This goes back even to the oldest (V7) version I could find:

Code:
       (1,$)g/regular expression/command list
            In the global command, the first step is to mark every line  which
            matches  the  given regular expression.  Then for every such line,
            the given command list is executed with `.' initially set to  that
            line.   A single command or the first of multiple commands appears
            on the same line with the global command.  All lines of  a  multi-
            line  list except the last line must be ended with `\'.  A, i, and
            c commands and associated input are permitted; the `.' terminating
            input  mode  may be omitted if it would be on the last line of the
            command list.  The commands g and v are not permitted in the  com‐
            mand list.

[1] "Ed is the standard text editor."
 
Reply

Tags
buysomethinelse, nokia support

Thread Tools

 
Forum Jump


All times are GMT. The time now is 15:28.