if you want to use Perl, use Perl. There's no need to cat the file. Pass it into perl as an argument. Also, don't cram everything into one line like that. Its hard to read and troubleshoot. Indent your code where necessary.
Hi ppl,
I am a bit lost on this...can some one assist. I know this can be down with awk or sed, but i cant get the exact syntax right.
I need to only extract the numbers from a signle word ( eg abcd.123.xyz )
How can i extract 123 only ?
Thanks (14 Replies)
Just wondering if someone could assist me with shell script I'm trying to write. I need to read the final column of a text file (shown below) and workout what the average number is. The text file will have a variable number of lines, I just want the script to pull out the values in the final field... (14 Replies)
Hey all, I am relatively poor at programming and unfortunately don't have time to read about programming at this current moment.
I wanted to be able to run a simple command to read a column of numbers in a file and give me the average of those numbers. In addition if I could specify the... (2 Replies)
Hi all,
I have a list of numbers. I need an awk command to find out the numbers of elements (number of numbers, sort to speak), the average value the min and max value. Reading the list only once, with awk.
Any ideas?
Thanks! (5 Replies)
Hello
I have created next scritpt to do the next: chekp if host is alive. When the host down, launch telnet other equip to do checks.
When execute the script the load average of the machines increase. For example:
Before launch script
top - 11:14:56 up 14 days, 18:06, 3 users, load... (3 Replies)
Hi,
I have 3 to 4 different files, from that i need to take a Average of numbers from a particular column. here i have to take 4th column,
that should present in diff. file.
File 1:
Col1 col2 col3 col4
1 11 sa 12.00
2 22 sb 134.59
3 33 sc 11.99
4 44 sd 12.44
Col1 col2 col3... (8 Replies)
For the data
I would like to parse down and for each parsing
I want a cumulative averaging, stored in an array
that can be output.
I.e.
546/NR = 546
(546+344)/NR=(546+344)/2 = etc.
For N record input I want N values of the average (a block
averaging effectively)
Any... (3 Replies)
Hello friends,I am new to Unix programming.
how do I achieve the following in Unix shell script (I am running ksh on AIX)
extract the number from name of file?
My file format is like "LongFileName-1234.020614-221030.txt"
now I want to extract value which is between (-) hyphen and (.) dot... (4 Replies)
Hello All,
What is load average and how is it computed in Solaris 10?
What are the different ranges for normal, warning and danger signs?
Kindly clarify.
Thank you,
Sunil Kumar (3 Replies)
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.5 (Maipo)
I have this script that will monitor filesystems and send me e-amil alerts.
#! /bin/ksh
DIST_LIST=monitor@...com
WORKDIR=/home/monitor
WARNLEVEL=90
MAIL_SUBJ="filesystems monitor on "$(hostname)
... (3 Replies)
Discussion started by: danielshell
3 Replies
LEARN ABOUT DEBIAN
mu-extract
MU-EXTRACT(1) General Commands Manual MU-EXTRACT(1)NAME
mu_extract - display and save message parts (attachments), and open them with other tools.
SYNOPSIS
mu extract [options] <file> mu extract [options] <file> <pattern>
DESCRIPTION
mu extact is the mu sub-command for extracting MIME-parts (e.g., attachments) from mail messages. It works on message files, and does not
require the message to be indexed in the database.
For attachments, the file name used when saving it, is the name of the attachment in the message. If there is no such name, or when saving
non-attachment MIME-parts, a name is derived from the message-id of the message.
If you specify a pattern (a case-insensitive regular expression) as the second argument, all attachments with filenames matching that pat-
tern will be extracted. The regular expressions are Perl-compatible (as per the PCRE-library).
Without any options, mu extract simply outputs the list of leaf MIME-parts in the message. Only 'leaf' MIME-parts (including RFC822 attach-
ments) are considered, multipart/* etc. are ignored.
OPTIONS -a, --save-attachments
save all MIME-parts that look like attachments.
--save-all
save all non-multipart MIME-parts.
--parts=<parts>
only consider the following numbered parts (comma-separated list).The numbers for the parts can be seen from running mu extract
without any options but only the message file.
--target-dir=<dir>
save the parts in the target directory rather than the current working directory.
--overwrite
overwrite existing files with the same name; by default overwriting is not allowed.
--play Try to 'play' (open) the attachment with the default
application for the particular file type. On MacOS, this uses the open program, on other platforms is uses xdg-open. You can choose
a different program by setting the MU_PLAY_PROGRAM environment variable.
EXAMPLES
To display information about all the MIME-parts in a message file:
$ mu extract msgfile
To extract MIME-part 3 and 4 from this message, overwriting existing files with the same name:
$ mu extract --parts=3,4 --overwrite msgfile
To extract all files ending in '.jpg' (case-insensitive):
$ mu extract msgfile '.*.jpg'
To extract an mp3-file, and play it in the the default mp3-playing application.
$ mu extract --play msgfile 'whoopsididitagain.mp3'
BUGS
Please report bugs if you find them: http://code.google.com/p/mu0/issues/list
AUTHOR
Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
SEE ALSO mu(1)User Manuals February 2012 MU-EXTRACT(1)