02-25-2011
Thanks for the advice - job works!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi
I want to verify that a process exists. if the process exists, then it means the service is up.
ps -ef | grep monito
returns an entry if the service is up.
how to translate that in a shell script??
many thanks (4 Replies)
Discussion started by: melanie_pfefer
4 Replies
2. Shell Programming and Scripting
I would like to monitor a log file using a shell script and as soon as a line with a certain string in it appears I would like to run a program. I have been playing around with doing this using tail -f, but cannot get it to work. I found something similar here:... (1 Reply)
Discussion started by: danielsbrewer
1 Replies
3. HP-UX
Hello,
I know this is somewhat strange, but please let me know if possible. I want to execute a program file in the remote machine with command on the local machine. Let me make things more clear.
Suppose I have a cc on my local system and do not have that on the remote system. I want to use... (2 Replies)
Discussion started by: Veera_Raghav
2 Replies
4. Programming
Hi all,
I want to assign a command name to a file.e.g.
suppose I have a .sh file "xyz.sh". I want to execute the file by typing in "abc".
The desired output is:
$ abc
should execute the "xyz.sh" file.
Kind Regards,
Qasim (4 Replies)
Discussion started by: qasim
4 Replies
5. Shell Programming and Scripting
Hello Experts,
I would like to know the best way to assign a value to variable from a given file and execute a command including this variable for each entry from the file. to be more clear, i have a file with different lines (each line with a different value). i want to substitute the variable... (2 Replies)
Discussion started by: Dendany83
2 Replies
6. Shell Programming and Scripting
Hi,
As a newbie, I'm desperate ro make my shell script work. I'd like a script which checks all the files in a directory, check the file name, if the file name ends with "extracted", store it in a variable, if it has a suffix of ".roi" stores in another variable. I'm going to use these two... (3 Replies)
Discussion started by: armando110
3 Replies
7. Shell Programming and Scripting
Good Morning All,
I'm a novice and please excuse me if i did miss some of the forum rules.
What my intention is, i have a file (services) residing @ /u01/Oracle/services.
I know i can use the find command to find the "service" file. I get this file from a windows box and there is no certain... (8 Replies)
Discussion started by: thinkingeye
8 Replies
8. Shell Programming and Scripting
I have written the following shell script
#!/bin/bash
file="/home/CSV/data.csv"
badfile="/home/CSV/bad/"
while IFS= read -r line
do
num_fields=`echo "$line" | awk -F'|' '{print NF}'`
field1=`echo "$line" | awk -F'|' '{print $1}'`
echo $num_fields
echo $field1
done <"$file"
the code is... (3 Replies)
Discussion started by: Tomar
3 Replies
9. Shell Programming and Scripting
Hi,
I have a variable returned from Oracle SQL Function which holds file names.
I would like to test if all the file names mentioned in the string exists in a directory. If all the files exists print "exists", even if one file does not exists print "Does not exists".
e.g.
... (3 Replies)
Discussion started by: pointers1234
3 Replies
10. Shell Programming and Scripting
We have a process where we store the database password in a config file like below from where the password is picked up and used in Database Scripts
ID, Password
But we now have a Audit Requirement not to have the passwords in Config Files directly. We have a command which could fetch the... (2 Replies)
Discussion started by: infernalhell
2 Replies
LEARN ABOUT OSX
posix_madvise
MADVISE(2) BSD System Calls Manual MADVISE(2)
NAME
madvise, posix_madvise -- give advice about use of memory
SYNOPSIS
#include <sys/mman.h>
int
madvise(void *addr, size_t len, int advice);
int
posix_madvise(void *addr, size_t len, int advice);
DESCRIPTION
The madvise() system call allows a process that has knowledge of its memory behavior to describe it to the system. The advice passed in may
be used by the system to alter its virtual memory paging strategy. This advice may improve application and system performance. The behavior
specified in advice can only be one of the following values:
MADV_NORMAL Indicates that the application has no advice to give on its behavior in the specified address range. This is the system
default behavior. This is used with madvise() system call.
POSIX_MADV_NORMAL
Same as MADV_NORMAL but used with posix_madvise() system call.
MADV_SEQUENTIAL Indicates that the application expects to access this address range in a sequential manner. This is used with madvise()
system call.
POSIX_MADV_SEQUENTIAL
Same as MADV_SEQUENTIAL but used with posix_madvise() system call.
MADV_RANDOM Indicates that the application expects to access this address range in a random manner. This is used with madvise() system
call.
POSIX_MADV_RANDOM
Same as MADV_RANDOM but used with posix_madvise() system call.
MADV_WILLNEED Indicates that the application expects to access this address range soon. This is used with madvise() system call.
POSIX_MADV_WILLNEED
Same as MADV_WILLNEED but used with posix_madvise() system call.
MADV_DONTNEED Indicates that the application is not expecting to access this address range soon. This is used with madvise() system call.
POSIX_MADV_DONTNEED
Same as MADV_DONTNEED but used with posix_madvise() system call.
MADV_FREE Indicates that the application will not need the information contained in this address range, so the pages may be reused
right away. The address range will remain valid. This is used with madvise() system call.
MADV_ZERO_WIRED_PAGES
Indicates that the application would like the wired pages in this address range to be zeroed out if the address range is
deallocated without first unwiring the pages (i.e. a munmap(2) without a preceding munlock(2) or the application quits).
This is used with madvise() system call.
The posix_madvise() behaves same as madvise() except that it uses values with POSIX_ prefix for the advice system call argument.
RETURN VALUES
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.
ERRORS
madvise() fails if one or more of the following are true:
[EINVAL] The value of advice is incorrect.
[EINVAL] The address range includes unallocated regions.
[ENOMEM] The virtual address range specified by the addr and len are outside the range allowed for the address space.
LEGACY SYNOPSIS
#include <sys/types.h>
#include <sys/mman.h>
int
madvise(caddr_t addr, size_t len, int advice);
int
posix_madvise(caddr_t addr, size_t len, int advice);
The include file <sys/types.h> is necessary. The type of addr has changed.
SEE ALSO
mincore(2), minherit(2), mprotect(2), msync(2), munmap(2), compat(5)
HISTORY
The madvise function first appeared in 4.4BSD. The posix_madvise function is part of IEEE 1003.1-2001 and was first implemented in Mac OS X
10.2.
BSD
June 9, 1993 BSD