12-09-2009
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I seem to have gotten myself in over my head on this one. I need help combining lines together.
I have a text file containing 24,000 lines (exactly why I need awk) due to bad formatting it has separated the lines (ideally it should be 12,000 lines total).
Example of file:
... (2 Replies)
Discussion started by: blueheed
2 Replies
2. Shell Programming and Scripting
Hello I am new to shell scripting. Below are 2 scripts which I need to combine in to single script.Can some experts guide me how to proceed?
#!/bin/bash
grep "2443" /f/log/s/heduler.log | grep 2443> /tmp/memorydump
exec 6<"/tmp/memorydump"
read -u 6 data
if
then
echo "IN THEN" <... (4 Replies)
Discussion started by: achararun
4 Replies
3. Shell Programming and Scripting
I am using:
ps -A -o command,%cpu
to get process and cpu usage figures. I want to use awk to split up the columns it returns. If I use:
awk '{print "Process: "$1"\nCPU Usage: "$NF"\n"}'
the $NF will get me the value in the last column, but if there is more than one word in the... (2 Replies)
Discussion started by: json4639
2 Replies
4. Shell Programming and Scripting
Hi ,
Following are the two scripts :-
Script 1)
#!/bin/sh
cp file.log file.log.1
Script 2)
#!/bin/sh
diff file.log file.log.1 > DIFFERENCE.log
cp file.log file.log.1
grep "ERROR" DIFFERENCE.log
if ; then
echo "1"
else
echo "0"
fi (1 Reply)
Discussion started by: himvat
1 Replies
5. UNIX for Dummies Questions & Answers
It would be convenient to be able to combine awk tests. For example, suppose that I do this query:
awk '$1 != "Bob" || $1 != "Linda" {print $2}' datafileIs there a reasonable way to combine the conditions into a single statement? For example, in egrep, I can do:
egrep -v "Bob|Linda"... (4 Replies)
Discussion started by: treesloth
4 Replies
6. Shell Programming and Scripting
Hi readers,
I have two shell scripts running on linux machine.
Both the scripts do the following task
- Connect to DB
- Create temp files
- run select statement on table
- write the rows returned on temp file
Sample code is below
#!/bin/sh
export ORACLE_HOME=/content/oracle/10.2.0... (1 Reply)
Discussion started by: manucorbi
1 Replies
7. Shell Programming and Scripting
I have a pretty simple script below:
#!/bin/sh
for i in *.cfg
do
temp=`awk '/^InputDirectory=/' ${i}`
input_dir=`echo ${temp} | awk '{ print substr( $0, 16) }'`
echo ${input_dir}
done
As you can see its opening each cfg file and searching for the line that has "InputDirectory="... (3 Replies)
Discussion started by: ssbsts
3 Replies
8. Shell Programming and Scripting
i have a datafile that has several lines that look like this:
2,dataflow,Sun Mar 17 16:50:01 2013,1363539001,2990,excelsheet,660,mortar,660,4
using the following command:
awk -F, '{$3=strftime("%a %b %d %T %Y,%s",$3)}1' OFS=, $DATAFILE | egrep -v "\-OLDISSUES," | ${AWK} "/${MONTH} ${DAY}... (7 Replies)
Discussion started by: SkySmart
7 Replies
9. Shell Programming and Scripting
i have a script that has many lines similar to:
echo $var | awk -F"--" '{print $2}'
as you can see, two commands are being run here. echo and awk.
id like to combine this into one awk statement.
i tried:
awk -F"--" "BEGIN{print $var; print $2}"
but i get error messages. (10 Replies)
Discussion started by: SkySmart
10 Replies
10. Shell Programming and Scripting
Hi Folks,
I have two scripts that are used to start and stop services these scripts are at the location /opt/app/tre , so that start.sh internally starts the components and stop.sh internally stop all the components, now rite now if I have to stop the services then i need to go first the... (9 Replies)
Discussion started by: punpun66
9 Replies
LEARN ABOUT DEBIAN
graphics::primitive::insets
Graphics::Primitive::Insets(3pm) User Contributed Perl Documentation Graphics::Primitive::Insets(3pm)
NAME
Graphics::Primitive::Insets - Space between things
DESCRIPTION
Graphics::Primitive::Insets represents the amount of space that surrounds something. This object can be used to represent either padding
or margins (in the CSS sense, one being inside the bounding box, the other being outside)
SYNOPSIS
use Graphics::Primitive::Insets;
my $insets = Graphics::Primitive::Insets->new({
top => 5,
bottom => 5,
left => 5,
right => 5
});
METHODS
Constructor
new Creates a new Graphics::Primitive::Insets.
Instance Methods
as_array
Return these insets as an array in the form of top, right, bottom and left.
bottom
Set/Get the inset from the bottom.
equal_to
Determine if these Insets are equal to another.
left
Set/Get the inset from the left.
right
Set/Get the inset from the right.
top Set/Get the inset from the top.
zero
Sets all the insets (top, left, bottom, right) to 0.
AUTHOR
Cory Watson, "<gphat@cpan.org>"
SEE ALSO
perl(1)
COPYRIGHT & LICENSE
Copyright 2008-2010 by Cory G Watson.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.12.3 2010-08-21 Graphics::Primitive::Insets(3pm)