I need to write a function that will work in sh/ksh shell that will test to see if a file has already been opened for writting by another user
has anyone written something like this? (3 Replies)
#!/bin/ksh
size=3978132853
limit=100
if ;then
echo exceeded limit
fi
This does not work though if i reduce 3978132853 to 397813285 it works any ideas and work around appreciated
(SunOS 5.9 Generic_117171-02 sun4u sparc SUNW,Ultra-80 ) (2 Replies)
Hi everybody,
I need to check in C program whether a given login is known on the system. Is there any system function that could do this ?
So far, all I could find is getpwnam(), which answers my problem by parsing the local password database. But won't work if a user is authenticated by... (2 Replies)
Hi,
I found this:
https://www.unix.com/unix-advanced-expert-users/27318-how-see-function-shell.html
which indicates I can use typeset -f to list the functions.
But it also lists the contents of the functions. Is there a
lighter weight way to see what is defined? Is there an
internal... (5 Replies)
I have found a code some where, which looks like
if (test $value)
then
<do something>
fi
I am not understanding what is test doing here. I have seen test with !,-eq, -e etc.
But, the above appears to be a new one to me.
Can anyone please expalin me. (4 Replies)
All,
I am getting error when run file check with test operator . Why is it showing the error
if
then
echo 'file found'
fi
ksh: -r: unknown test operator
I know i can use the below code to test the file but why the above is not working
if test -r filename
... (3 Replies)
I ran into the following and still do not understand entirely the rationale behind this. If someone could explain why things are as they are I'd be thankful.
The following was tested on AIX 7.1 with ksh88, but i suspect that to be ubiquitous. In an installation routine i had to create a set of... (6 Replies)
Hello everyone,
I have written simple script below to check if ip is added to interface
#!/usr/local/bin/bash
IFCONFIG="/sbin/ifconfig"
SERVICE="/usr/sbin/service"
IP="79.137.X.X"
GREP=$(${IFCONFIG} | grep ${IP})
ip_quantity_check () {
echo ${GREP} | wc -l
}
if ];... (2 Replies)