07-21-2010
Grep result loses formatting
I am searching for a string in a file and then redirecting the contents in another file... however the formatting is not preserved.. Can you please help me on this ...
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am new to unix. i need to know how to use grep to grep and expression from a file. and pass the result as a 0 for found and 1 for not found. I can only go up to grep 'Checking Subscription Status' ranos.log. Please help. Thank you. (2 Replies)
Discussion started by: Hak Dee
2 Replies
2. UNIX for Dummies Questions & Answers
Hi guys,
I have the following grep command in a script to search through a file for a string and return its count, and it works fine for when the string exists:
grep "string" file.txt | wc
However, sometimes the result will be 0 and I want the script to take this as the result. Right now... (6 Replies)
Discussion started by: ocelot
6 Replies
3. Shell Programming and Scripting
Hi,
I have about 12 columns and 15 rows to be retrived from sybase isql command through unix. But when i output the sql into a file and see it, the formatting is going for a toss. can someone please suggest how can i get the result correctly in the output file ?
Thanks,
Sateesh (2 Replies)
Discussion started by: kotasateesh
2 Replies
4. Shell Programming and Scripting
Hi,
My code is like this
if swlist -a revision 2>/dev/null | grep ABC 2>/dev/null
then
echo "Found Above mentioned ABC Version, please remove it first..."
fi
This is displaying the result to the screen.
i want to first suppress that and for that i wrote the below... (1 Reply)
Discussion started by: rag84dec
1 Replies
5. Shell Programming and Scripting
Here is my script so far:
set dirs = ` find . -name "message.jar" 2> /dev/null | cut -d "/" -f 2 ` | uniq
foreach dir ( $dirs )
if (grep $dir/* someText==null) --> how do I write this in script?
print $dir
end
end (4 Replies)
Discussion started by: mmdawg
4 Replies
6. Shell Programming and Scripting
Trying to create a command line script to look for all files matching a pattern, grep for a specific value in each file, and write out the filename long list. It's possible the filename won't containe the value.
{
echo “Running....”
for fname in 811_Intermediate_File_*
do
grep -l... (3 Replies)
Discussion started by: gavineq
3 Replies
7. Solaris
Hi
While trying to do a search on solaris, the grep results seems to be appearing on the same line instead of the new line.
Wed Jan 18 14:45:48 weblogic@test:/abcd$ grep qainejb02 *
qa_cluster_biz_view_tc_intl_servers_ports_2:qainejb02 7101
qa_cluster_servers_2:qainejb02... (2 Replies)
Discussion started by: ganga.dharan
2 Replies
8. UNIX for Dummies Questions & Answers
Hello.
I want to get all modules which are loaded and which name are exactly 2 characters long and not more than 2 characters and begin with "nv"
lsmod | (e)grep '^nv????????????
I want to get all modules which are loaded and which name begin with "nv" and are 2 to 7 characters long
... (1 Reply)
Discussion started by: jcdole
1 Replies
9. Shell Programming and Scripting
Hi,
I have a .sh file, to email a report of our backups from a linux machine. It looks like this (minus a few bits):
echo "HELO $host.$domain"
sleep 1
echo "mail from: vdrreport@$domain"
sleep 1
echo "rcpt to:$mailto"
sleep 1
echo "data"
sleep 1
echo "subject: $host VDR-Report... (2 Replies)
Discussion started by: cognito
2 Replies
10. Shell Programming and Scripting
Hi,
I am running following command in a bash script for testing IO and use grep to get throughput number, but it did not work, it displayed everything:
dd if=/dev/zero of=/dev/null bs=1G count=1 oflag=dsync | grep bytes | awk '{print $7}'
1+0 records in
1+0 records out
536870912 bytes... (2 Replies)
Discussion started by: hce
2 Replies
LEARN ABOUT SUSE
pod::parselink
Pod::ParseLink(3pm) Perl Programmers Reference Guide Pod::ParseLink(3pm)
NAME
Pod::ParseLink - Parse an L<> formatting code in POD text
SYNOPSIS
use Pod::ParseLink;
my ($text, $inferred, $name, $section, $type) = parselink ($link);
DESCRIPTION
This module only provides a single function, parselink(), which takes the text of an L<> formatting code and parses it. It returns the
anchor text for the link (if any was given), the anchor text possibly inferred from the name and section, the name or URL, the section if
any, and the type of link. The type will be one of "url", "pod", or "man", indicating a URL, a link to a POD page, or a link to a Unix
manual page.
Parsing is implemented per perlpodspec. For backward compatibility, links where there is no section and name contains spaces, or links
where the entirety of the link (except for the anchor text if given) is enclosed in double-quotes are interpreted as links to a section
(L</section>).
The inferred anchor text is implemented per perlpodspec:
L<name> => L<name|name>
L</section> => L<"section"|/section>
L<name/section> => L<"section" in name|name/section>
The name may contain embedded E<> and Z<> formatting codes, and the section, anchor text, and inferred anchor text may contain any
formatting codes. Any double quotes around the section are removed as part of the parsing, as is any leading or trailing whitespace.
If the text of the L<> escape is entirely enclosed in double quotes, it's interpreted as a link to a section for backward compatibility.
No attempt is made to resolve formatting codes. This must be done after calling parselink() (since E<> formatting codes can be used to
escape characters that would otherwise be significant to the parser and resolving them before parsing would result in an incorrect parse of
a formatting code like:
L<verticalE<verbar>barE<sol>slash>
which should be interpreted as a link to the "vertical|bar/slash" POD page and not as a link to the "slash" section of the "bar" POD page
with an anchor text of "vertical". Note that not only the anchor text will need to have formatting codes expanded, but so will the target
of the link (to deal with E<> and Z<> formatting codes), and special handling of the section may be necessary depending on whether the
translator wants to consider markup in sections to be significant when resolving links. See perlpodspec for more information.
SEE ALSO
Pod::Parser
The current version of this module is always available from its web site at <http://www.eyrie.org/~eagle/software/podlators/>.
AUTHOR
Russ Allbery <rra@stanford.edu>.
COPYRIGHT AND LICENSE
Copyright 2001, 2008, 2009 Russ Allbery <rra@stanford.edu>.
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
perl v5.12.1 2010-04-26 Pod::ParseLink(3pm)