this line is all what i need in my file right? what type of script is this? what name should i save it under? thank you!
This line in itself is not a complete script it's just a small snippet which is responsible of sending an email
It's totally up to you to name it whatever you want
for an example myscript.sh
Make it executable
a file is created on a daily basis in the name xyz_pqr_20071207.dat.i want to send the file as an attachment if the file contains more than 50 records.how can i write a script such that it will transmit the file after the file is created.i want to sed the file to say asdf@xyz.com.
please help me... (2 Replies)
Hi Experts,
I am writing a script in which i want to parse the file and send the emails to some email-id's.
The problem is like this--
I use to get some emails on saturday and sunday's but we do not work on these days. So what i want to do is forward those emails to some email id's.
I want... (1 Reply)
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 one script which is as below
do
some sqlplus output in to $LOG
sed '/^$/d' $LOG > /tmp/job.log
mv /tmp/job.log $LOG
awk '{if ($5=="COMPLETED") {print "backup completed at "$3" "$4 " of " $6 " for " d>> "/home/email.log" } else {print "check backup for " d}}' d="$ORACLE_SID"... (2 Replies)
So I was just wondering... Is there a way to send a file directly to the computer..... Ive never gotten the answer and I want to know how, I keep running in to a wall :wall:. Why you may ask, well really for security reasons due to the fact that if this is done via a port I want to make sure to... (3 Replies)
Hi,
I require need help in two aspects actually:
1) Fatal error that gets generated as %F% from a log file say ABClog.dat to trigger a mail. At present I manually grep the log file as <grep %F% ABClog.dat| cut-d "%" -f1>. The idea is to use this same logic to grep the log file which is... (1 Reply)
I have a file like this. I need to ues this file to send emails to the appropriate ID/group.
For instance in the first line
- Subject should be --> "A1.csv - ABC"
- Body should be --> File A1.csv has changed.
- Email should be sent to A1@xyz.com,A3@xyz.com
Lookup.csv:
... (1 Reply)
i want to zip the 2GB file
and send it via email from unix machine using uuencode.
could you please suggest whether it will possible or not
and also command to do it. (3 Replies)
Hi
my requirement is that i want pull the bad records from input file and move those records in to a seperate file.
that file has to be sent via email..
any suggentions please (1 Reply)
Discussion started by: sxk4999
1 Replies
LEARN ABOUT NETBSD
setmode
SETMODE(3) BSD Library Functions Manual SETMODE(3)NAME
getmode, setmode -- modify mode bits
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <unistd.h>
void *
setmode(const char *mode_str);
mode_t
getmode(const void *set, mode_t mode);
DESCRIPTION
The setmode() function accepts a string representation of a file mode change, compiles it to binary form, and returns an abstract representa-
tion that may be passed to getmode(). The string may be an numeric (octal) or symbolic string of the form accepted by chmod(1), and may rep-
resent either an exact mode to set or a change to make to the existing mode.
The getmode() function adjusts the file permission bits given by mode according to the compiled change representation set, and returns the
adjusted mode. While only the permission bits are altered, other parts of the file mode, particularly the type, may be examined.
Because some of the possible symbolic values are defined relative to the file creation mask, setmode() may call umask(2), temporarily chang-
ing the mask. If this occurs, the file creation mask will be restored before setmode() returns. If the calling program changes the value of
its file creation mask after calling setmode(), setmode() must be called again to recompile the mode string if getmode() is to modify future
file modes correctly.
If the mode passed to setmode() is invalid, setmode() returns NULL.
EXAMPLES
The effects of the shell command 'chmod a+x myscript.sh' can be duplicated as follows:
const char *file = "myscript.sh";
struct stat st;
mode_t newmode;
stat(file, &st);
newmode = getmode(setmode("a+x"), st.st_mode);
chmod(file, newmode);
ERRORS
The setmode() function may fail and set errno for any of the errors specified for the library routines malloc(3) or strtol(3). In addition,
setmode() will fail and set errno to:
[EINVAL] The mode argument does not represent a valid mode.
SEE ALSO chmod(1), stat(2), umask(2), malloc(3)HISTORY
The getmode() and setmode() functions first appeared in 4.4BSD.
BUGS
Each call to setmode allocates a small amount of memory that there is no correct way to free.
The type of set should really be some opaque struct type used only by these functions rather than void *.
BSD January 4, 2009 BSD