01-04-2008
it's kind of funny cus i actually spent about 30 mins on google before i came back on here...
but i think i got something that will improvise...i'll post something back if it works as expected or not...thanks
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi again. Sorry if it seems like I'm spamming the boards a bit, but I figured I might as well ask all the questions I need answers to at once, and hopefully at least get some.
I have installed Solaris 10 on a server. The default text editors are there (vi, ex, ed, maybe others, I know emacs is... (4 Replies)
Discussion started by: EugeneG
4 Replies
2. Shell Programming and Scripting
Hi,
I am having huge file with the following lines.
2007:10:01:00:00:49:GMT: subject=BMRA.BM.T_ABTH7.FPN, message={SD=2007:10:01:00:00:00:GMT,SP=5,NP=2,TS=2007:10:01:01:00:00:GMT,VP=0.0,TS=2007:10:01:01:30:00:GMT,VP=0.0}
2007:10:01:00:00:49:GMT: subject=BMRA.BM.T_ABTH7G.FPN,... (9 Replies)
Discussion started by: nathasha
9 Replies
3. Shell Programming and Scripting
I have a data file in the following format (refer to input file) with multiple lines containing some information. I need an output file to loop thorough the input file with summarized information as seen below (refer to output file) ‘Date Time' and ‘Beta Id' input file values should be concatenated... (7 Replies)
Discussion started by: shekharaj
7 Replies
4. Shell Programming and Scripting
Hi
I have a set of options in the form of key value in a file. Need to find a particular value of 'a' and delete all lines till the next 'a' keyword .
Ex :
a bbb
c ddd
e fff
g hhh
a sss
c ggg
e xxx
f sss
a ddd
d sss
r sss
g hhh (5 Replies)
Discussion started by: TDUser
5 Replies
5. Shell Programming and Scripting
Hello,
For the life of me, I can't figure out how to extract only certain lines of a file. For example, the file contains:
project.max-sem-ids
privileged 1.02K - deny -
system 16.8M max deny ... (2 Replies)
Discussion started by: PointyWombat
2 Replies
6. UNIX for Dummies Questions & Answers
Hi All,
I need help on the following req.
I am getting output of a command as follows:
16377612 total memory
3802460 used memory
2827076 active memory
681948 inactive memory
12575152 free memory
477452 buffer memory
I want to compute used... (1 Reply)
Discussion started by: mailsara
1 Replies
7. Shell Programming and Scripting
I have file which is having 500 lines. I want to get the first 100 lines then sleep, then again next 100 lines sleep so now till the end of the file.
Can someone tell me in perl and bash.
also i want to do it in threads.
Thanks.. (6 Replies)
Discussion started by: Anjan1
6 Replies
8. Shell Programming and Scripting
I have a tool which generates results in a file at every minute and which has following columns.
I need to create a script checks this file constantly and if Column ( QOM ) has value more then "30S" it should send an email.
Can anybody help ?
Thansk a lot.
Time MxML MxQD G P OIC OUC MDC... (11 Replies)
Discussion started by: jayeshpatel
11 Replies
9. Shell Programming and Scripting
What is the correct syntax to have the awk parse the next line as well? The next in bold is where I think it should go, but I wanted to ask the experts since I am a beginner. The file to be parsed is attached as well. Thank you :).
awk 'NR==2 {split($2,a,"");b=substr(a,1,length(a-1));print... (6 Replies)
Discussion started by: cmccabe
6 Replies
10. Shell Programming and Scripting
GM,
I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed.
I am assuming that sed, awk or even perl could do what I need.
I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
Discussion started by: jxfish2
7 Replies
LEARN ABOUT FREEBSD
fortune
FORTUNE(6) BSD Games Manual FORTUNE(6)
NAME
fortune -- print a random, hopefully interesting, adage
SYNOPSIS
fortune [-aDefilosw] [-m pattern] [[N%] file/directory/all]
DESCRIPTION
When fortune is run with no arguments it prints out a random epigram. Epigrams are divided into several categories, where each category is
subdivided into those which are potentially offensive and those which are not. The options are as follows:
-a Choose from all lists of maxims, both offensive and not. (See the -o option for more information on offensive fortunes.)
-D Enable additional debugging output. Specify this option multiple times for more verbose output. Only available if compiled with
-DDEBUG.
-e Consider all fortune files to be of equal size (see discussion below on multiple files).
-f Print out the list of files which would be searched, but do not print a fortune.
-l Long dictums only.
-m pattern
Print out all fortunes which match the regular expression pattern. See regex(3) for a description of patterns.
-o Choose only from potentially offensive aphorisms. Please, please, please request a potentially offensive fortune if and only if you
believe, deep down in your heart, that you are willing to be offended. (And that if you are not willing, you will just quit using -o
rather than give us grief about it, okay?)
... let us keep in mind the basic governing philosophy
of The Brotherhood, as handsomely summarized in these words:
we believe in healthy, hearty laughter -- at the expense of
the whole human race, if needs be.
Needs be.
--H. Allen Smith, "Rude Jokes"
-s Short apothegms only.
-i Ignore case for -m patterns.
-w Wait before termination for an amount of time calculated from the number of characters in the message. This is useful if it is exe-
cuted as part of the logout procedure to guarantee that the message can be read before the screen is cleared.
The user may specify alternate sayings. You can specify a specific file, a directory which contains one or more files, or the special word
all which says to use all the standard databases. Any of these may be preceded by a percentage, which is a number N between 0 and 100 inclu-
sive, followed by a '%'. If it is, there will be an N percent probability that an adage will be picked from that file or directory. If the
percentages do not sum to 100, and there are specifications without percentages, the remaining percent will apply to those files and/or
directories, in which case the probability of selecting from one of them will be based on their relative sizes.
As an example, given two databases funny and not-funny, with funny twice as big, saying
fortune funny not-funny
will get you fortunes out of funny two-thirds of the time. The command
fortune 90% funny 10% not-funny
will pick out 90% of its fortunes from funny (the ``10% not-funny'' is unnecessary, since 10% is all that is left). The -e option says to
consider all files equal; thus
fortune -e funny not-funny
is equivalent to
fortune 50% funny 50% not-funny
ENVIRONMENT
FORTUNE_PATH The search path for the data files. It is a colon-separated list of directories in which fortune looks for data files. If not
set it will default to /usr/share/games/fortune. If none of the directories specified exist, it will print a warning and exit.
FORTUNE_SAVESTATE
If set, fortune will save some state about what fortune it was up to on disk.
FILES
/usr/games/fortune
/usr/share/games/fortune/* the fortunes databases (those files ending ``-o'' contain the offensive fortunes)
SEE ALSO
arc4random_uniform(3), regcomp(3), regex(3), strfile(8)
BSD
November 7, 2007 BSD