Don't forget the input file. Note that this method is more efficient than cat'ing the file and piping it to the while loop (you might get a useless use of cat award reconstruction of the Award text. :-) One less process needed. There are some other good tips on that page too.
Hi all,
I want to know how to send an email using shell script .....
I tried a command call mail but it did not work..
Please any one reply.. With example if you know thanks..
Madhu (4 Replies)
Hi All
i am writing a shell script which will search for a string "expires". once the search string is found it has to give the email address as the output and send an email to the person
This is basically to find the encrypetd keys which are loaded in the unix server
Below are sample... (10 Replies)
Hi,
Someone Knows how to obtein a chain from a unix file, but not all the line, for exemple, for this file ,obtein only 902111111 and to keep the value, this value will be used to make a mailx.
NF=ALL,
SUBJ=
FROM: SN=CD, SE=TOPCALL, NA=, N=902111111, N=TCLFI
TO: SE=FAX, NA=, C1=... (0 Replies)
Hi ,
I am new to shell scripting. i have a requirement say i will receive a file in a directory say /xyz.if that file stays in that directory more than 30 min i need to get a mail to my outlook.this should run for every 20 min in crontab.
can anyone help me? (8 Replies)
hi,
i have to send an email once a day at ceratin time say 22.
i have tried with date commad, but not working.:(
HOUROFTHEDAY=`date +'%H'`
if ; then
mailx -s "Info" emailid@org.com < $ProcessStatisticsFile
fi
Please help me... (5 Replies)
Hi All,
I am new to the unix , i have to deliver one script very urgently
I have to write a shell script where i have i want to send email to specific email id
in this script i want
FROM to be parameterized and stored in a variable
TO to be parameterized and stored in a variable... (3 Replies)
Hello ,
I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them .
I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Hi Guys,
I have this script which will monitor oracle db process if up or down.And I want it to send email if it's down and the time it's back to online. However my script just keep on sending "Email Up" if the db is up or "Email Down" if the db is down.Is there any way to trap it so that it... (5 Replies)
This is my below script which is working fine as it send only plain text email.
So My question is- How can I modify my below script to send this as an HTML formatted email? I want to show the text color of this expression `(echo "100*$TEST2/$TEST1" | bc -l)` as `RED` in an email and that can be... (3 Replies)
Hi All,
I have the below code(.sh) and need to send an email.
#!/bin/bash
cp /u02/xxc_incoming/TEST*.dat /u02/xxc_archive_incoming/AMER7764_ARPP_2/
cat /u02/xxc_incoming/TEST*.dat > /u02/xxc_incoming/XXC_TEST.dat
rm /u02/xxc_incoming/TEST*.dat
cd $XXC_TOP/bin
sqlldr userid=apps/<pwd> ... (12 Replies)
Discussion started by: Mist123
12 Replies
LEARN ABOUT SUNOS
cat
cat(1) User Commands cat(1)NAME
cat - concatenate and display files
SYNOPSIS
cat [-nbsuvet] [file...]
DESCRIPTION
The cat utility reads each file in sequence and writes it on the standard output. Thus:
example% cat file
prints file on your terminal, and:
example% cat file1 file2 >file3
concatenates file1 and file2, and writes the results in file3. If no input file is given, cat reads from the standard input file.
OPTIONS
The following options are supported:
-n Precede each line output with its line number.
-b Number the lines, as -n, but omit the line numbers from blank lines.
-u The output is not buffered. (The default is buffered output.)
-s cat is silent about non-existent files.
-v Non-printing characters (with the exception of tabs, new-lines and form-feeds) are printed visibly. ASCII control characters
(octal 000 - 037) are printed as ^n, where n is the corresponding ASCII character in the range octal 100 - 137 (@, A, B, C, . . .,
X, Y, Z, [, , ], ^, and _); the DEL character (octal 0177) is printed ^?. Other non-printable characters are printed as M-x,
where x is the ASCII character specified by the low-order seven bits.
When used with the -v option, the following options may be used:
-e A $ character will be printed at the end of each line (prior to the new-line).
-t Tabs will be printed as ^I's and formfeeds to be printed as ^L's.
The -e and -t options are ignored if the -v option is not specified.
OPERANDS
The following operand is supported:
file A path name of an input file. If no file is specified, the standard input is used. If file is `-', cat will read from the
standard input at that point in the sequence. cat will not close and reopen standard input when it is referenced in this
way, but will accept multiple occurrences of `-' as file.
USAGE
See largefile(5) for the description of the behavior of cat when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes).
EXAMPLES
Example 1: Concatenating a file
The following command:
example% cat myfile
writes the contents of the file myfile to standard output.
Example 2: Concatenating two files into one
The following command:
example% cat doc1 doc2 > doc.all
concatenates the files doc1 and doc2 and writes the result to doc.all.
Example 3: Concatenating two arbitrary pieces of input with a single invocation
The command:
example% cat start - middle - end > file
when standard input is a terminal, gets two arbitrary pieces of input from the terminal with a single invocation of cat. Note, however,
that if standard input is a regular file, this would be equivalent to the command:
cat start - middle /dev/null end > file
because the entire contents of the file would be consumed by cat the first time `-' was used as a file operand and an end-of-file condition
would be detected immediately when `-' was referenced the second time.
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of cat: LANG, LC_ALL, LC_CTYPE, LC_MES-
SAGES, and NLSPATH.
EXIT STATUS
The following exit values are returned:
0 All input files were output successfully.
>0 An error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|CSI |enabled |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO touch(1), attributes(5), environ(5), largefile(5), standards(5)NOTES
Redirecting the output of cat onto one of the files being read will cause the loss of the data originally in the file being read. For exam-
ple,
example% cat filename1 filename2 >filename1
causes the original data in filename1 to be lost.
SunOS 5.10 1 Feb 1995 cat(1)