Hi,
If I want to have a look at few lines of the file, how do I, what command to use.
Eg: If I have a file having length 2000 lines and I want to have a look at the content between 1400 and 1600, How do I look at it ?
Also, If I want to have a look at function alone in a file, how do I go... (4 Replies)
This is truly dummy question.
I have a text file of 100 lines.
What unix commnad to extract line 20 to 40 and output it to another file?
Is it something cat or grep or >> ?
Thanks (6 Replies)
Hi,
I am using the Korn shell script to display lines of the file. For example below:
outputfile=test.dat
-- display each line of the test.dat file
abcd 345
adek 45566
dve3 34565
so on...
I appreciate your time to find a command for displaying lines of the file on the log.
... (2 Replies)
Hi
to all in this great forum, im sure this has been asked lots of times before but ive been looking for the past day and cant find the answer.
I use cat/some/file to display its contents but how can i get it to not display hashed out lines, or do i need another command,
Thanks in advance:) (5 Replies)
I have to grep on a few words in a file and then display the line containing those words and the line above it.
For ex -
File1.txt contains...
abc xyz abc
This is a test
Test successful
abc xyz abc
Just a test
Test successful
I find the words 'Test successful' in the file... (6 Replies)
Hi!
I'm trying to create a shell script to parse a file which might have multiple lines matching a pattern (i.e. containing some word).
I need to return all lines matching the pattern, but stripping the contents of that line until the pattern is matched
For example, if my input file was
... (4 Replies)
a. How do I display the content of the file containing what Ive merged using a filter which would display only the lines of the file which don't contain number, for example 3 or 6. (3 Replies)
I have a bunch of files in various folders. I want to go through each of them and display certain lines in a particular format
All files have a similar format
Date:
Time:
User:
Message:
Miscellaneous:
(and some other stuff)I want to display to only the "Date:", "Time:" "User:" lines in... (7 Replies)
Hell,
I want to grep certain word from file and display above 2 lines and after two lines.
Here is the content of sample file.
Mar 14, 2013 12:56:59 AM Agent.Agent SendTo
INFO: Connection to server:7041 - Credential Transmit Successesful
Mar 14, 2013 8:54:21 AM cgent SendTo
WARNING:... (7 Replies)
Discussion started by: balareddy
7 Replies
LEARN ABOUT REDHAT
escape
escape(1) Mail Avenger 0.8.3 escape(1)NAME
escape - escape shell special characters in a string
SYNOPSIS
escape string
DESCRIPTION
escape prepends a "" character to all shell special characters in string, making it safe to compose a shell command with the result.
EXAMPLES
The following is a contrived example showing how one can unintentionally end up executing the contents of a string:
$ var='; echo gotcha!'
$ eval echo hi $var
hi
gotcha!
$
Using escape, one can avoid executing the contents of $var:
$ eval echo hi `escape "$var"`
hi ; echo gotcha!
$
A less contrived example is passing arguments to Mail Avenger bodytest commands containing possibly unsafe environment variables. For
example, you might write a hypothetical reject_bcc script to reject mail not explicitly addressed to the recipient:
#!/bin/sh
formail -x to -x cc -x resent-to -x resent-cc
| fgrep "$1" > /dev/null
&& exit 0
echo "<$1>.. address does not accept blind carbon copies"
exit 100
To invoke this script, passing it the recipient address as an argument, you would need to put the following in your Mail Avenger rcpt
script:
bodytest reject_bcc `escape "$RECIPIENT"`
SEE ALSO avenger(1),
The Mail Avenger home page: <http://www.mailavenger.org/>.
BUGS
escape is designed for the Bourne shell, which is what Mail Avenger scripts use. escape might or might not work with other shells.
AUTHOR
David Mazieres
Mail Avenger 0.8.3 2012-04-05 escape(1)