02-01-2012
search a word and copy the file
Hi need help with a script or command
My requirement is
- I need to do a "ls -ltr tcserver*.syslog" files in /tmp, direct the output to a file
HTML Code:
ls -ltr tcserv*.syslog | grep "Jan 31" | awk '{printf "\n" $9}' > jandat.logs
-Then open each file in above list and search for string/word, if the word is there then copy the file name to another out put file
HTML Code:
cat jandat.logs| while read LOG;do
grep -i "EXCEPTION: O/S ERROR: signal 6" $LOG && echo ${LOG} >> jansig.log
some how above script is not working, here is the full script
HTML Code:
#!/bin/ksh -x
DATE=$1
ls -ltr tcserv*.syslog | grep "Jan 31" | awk '{printf "\n" $9}' > jandat.logs
cat jandat.logs| while read LOG;do
grep -i "EXCEPTION: O/S ERROR: signal 6" $LOG && echo ${LOG} >> jansig.log
done
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have a file which contains some SQL statements. I need to take out the table name from the file. Table name will always end with "_t". can anyone help me in getting that?
for e.g.
---
SQL_STMT do_sql_insert: cmd="insert into account_t ( poid_DB, poid_ID0, poid_TYPE, poid_REV,... (9 Replies)
Discussion started by: vishy
9 Replies
2. Solaris
Hello,
Can anybody please tell me how we can copy and paste text from a word document into a text file that we are editing in vi? Is it possible to do that while we are editing the text file in vi in insert mode?
Thanks, (3 Replies)
Discussion started by: Pouchie1
3 Replies
3. Shell Programming and Scripting
Hi
I'm trying to search for the last instance of the word 'cache' in a HTML file that I have downloaded from YouTube.
I'm using the following syntax, but an error is thrown when I try it.
grep -f "cache"
Also I wish to append the above grep command to the below so that the search for cache... (3 Replies)
Discussion started by: colmbell
3 Replies
4. Shell Programming and Scripting
How to search for a word like "computer" in a column (eg: 4th field) of a '***' delimited file and add a column at the end of the record which denotes 'Y' if present and 'N' if not. After this, we need to again check for words like 'Dell' but not 'DellXPS' in 5th field and again add another column... (5 Replies)
Discussion started by: Jassz
5 Replies
5. Shell Programming and Scripting
I'm drawing blank on this. The log file I have is filled with garbage, but the important lines are ##/##/### Installation xxxxxxx
So, I want to sed the line to a new file IF the word installation is in it.
I tried removing none matching lines
sed 's/Installation/,//!d' infile > outfile
but that... (3 Replies)
Discussion started by: dba_frog
3 Replies
6. Shell Programming and Scripting
Hello,
I have a unix file about 3000lines which i want to copy from and paste it into a Word document. If i cat the file and try to scroll through it then not everything is captured so i am getting and incomplete paste.
Any help is really appreciated.
jak (2 Replies)
Discussion started by: jakSun8
2 Replies
7. Shell Programming and Scripting
I am a newbie and would like some help with the following -
Trying to search fileA for a string similar to -
AS11000022010 30.4 31.7 43.7 53.8 60.5 71.1 75.2 74.7 66.9 56.6 42.7 32.5 53.3
I then want to replace that string with a string from fileB - ... (5 Replies)
Discussion started by: ncwxpanther
5 Replies
8. UNIX for Dummies Questions & Answers
Hi I would like to know how to copy a file opened in unix editor like Nedit or vi editor to a word document
Since I am newbie I want to make sure I am not really copying onto real subdirectories
I tried to right click and copy the entire .sql file or any other file opened..
Nedit doesn't... (3 Replies)
Discussion started by: swathi123
3 Replies
9. Shell Programming and Scripting
How to search a particular word in a file.
in my file contains lacks of rows. (2 Replies)
Discussion started by: pmreddy
2 Replies
10. Shell Programming and Scripting
Hi,
I have a sample file as shown below, I am looking for sed or any command which prints the complete word only from the input file.
Ex:
$ cat "sample.log"
I am searching for a word which is present in this file
We can do a pattern search using grep but I need to cut only the word which... (1 Reply)
Discussion started by: mohan_kumarcs
1 Replies
LEARN ABOUT DEBIAN
pango::context
Pango::Context(3pm) User Contributed Perl Documentation Pango::Context(3pm)
NAME
Pango::Context - Pango object that stores global information used to control the itemization process
HIERARCHY
Glib::Object
+----Pango::Context
METHODS
direction = $context->get_base_dir
$context->set_base_dir ($direction)
o $direction (Pango::Direction)
gravity = $context->get_base_gravity
Since: pango 1.16
$context->set_base_gravity ($gravity)
o $gravity (Pango::Gravity)
Since: pango 1.16
fontdescription = $context->get_font_description
$context->set_font_description ($desc)
o $desc (Pango::FontDescription)
fontmap = $context->get_font_map
Since: pango 1.6
gravity = $context->get_gravity
Since: pango 1.16
gravityhint = $context->get_gravity_hint
Since: pango 1.16
$context->set_gravity_hint ($hint)
o $hint (Pango::GravityHint)
Since: pango 1.16
language = $context->get_language
$context->set_language ($language)
o $language (Pango::Language)
@families = $context->list_families
font = $context->load_font ($desc)
o $desc (Pango::FontDescription or undef)
fontset = $context->load_fontset ($desc, $language)
o $desc (Pango::FontDescription)
o $language (Pango::Language or undef)
matrix or undef = $context->get_matrix
Since: pango 1.6
$context->set_matrix ($matrix)
o $matrix (Pango::Matrix or undef)
Since: pango 1.6
fontmetrics = $context->get_metrics ($desc, $language)
o $desc (Pango::FontDescription)
o $language (Pango::Language or undef)
ENUMS AND FLAGS
enum Pango::Direction
o 'ltr' / 'PANGO_DIRECTION_LTR'
o 'rtl' / 'PANGO_DIRECTION_RTL'
o 'ttb-ltr' / 'PANGO_DIRECTION_TTB_LTR'
o 'ttb-rtl' / 'PANGO_DIRECTION_TTB_RTL'
o 'weak-ltr' / 'PANGO_DIRECTION_WEAK_LTR'
o 'weak-rtl' / 'PANGO_DIRECTION_WEAK_RTL'
o 'neutral' / 'PANGO_DIRECTION_NEUTRAL'
enum Pango::Gravity
o 'south' / 'PANGO_GRAVITY_SOUTH'
o 'east' / 'PANGO_GRAVITY_EAST'
o 'north' / 'PANGO_GRAVITY_NORTH'
o 'west' / 'PANGO_GRAVITY_WEST'
o 'auto' / 'PANGO_GRAVITY_AUTO'
enum Pango::GravityHint
o 'natural' / 'PANGO_GRAVITY_HINT_NATURAL'
o 'strong' / 'PANGO_GRAVITY_HINT_STRONG'
o 'line' / 'PANGO_GRAVITY_HINT_LINE'
SEE ALSO
Pango, Glib::Object
COPYRIGHT
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Pango for a full notice.
perl v5.14.2 2011-11-15 Pango::Context(3pm)