03-15-2017
well solved - i turned out like a newbie
i put the DEBUG after if statement and since this if didn't kicked in the function didn't work.
thanks sorry
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have written a script which does a following functions:-
1) Check a area if it is mounted or not
2) If the area is not mounted it will prompt the user to mount the are.
3) Once the area is mounted and the option is given as Y or y
the script continues...
My question is will the below... (2 Replies)
Discussion started by: kamlesh_p
2 Replies
2. Web Development
hi,
how can i can pass the value of unixformat to date/time? and how can i retrieve the day/month/year from a date?
thanks a lot for your help
ps:i using php (1 Reply)
Discussion started by: jasonx22
1 Replies
3. Programming
I use FreeBSD,and use signal,like follows:
signal(SIGHUP,sig_hup);
signal(SIGIO,sig_io);
when I run call following code,it can run,but I find a puzzled question,it should print some information,such as printf("execute main()") will print execute main(),but in fact,printf fuction print... (2 Replies)
Discussion started by: konvalo
2 Replies
4. Shell Programming and Scripting
Hello again,
Am having an issue now with getting a simple grep command to work within a function..
The function is as below...
function findRecord() {
output=grep "001" recordDatabase
echo $output
}
At the moment the "001"... (3 Replies)
Discussion started by: U_C_Dispatj
3 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I want to copy a file/directory ( recursively , if needed) and if destination directory does not exist create it ( with parent directory, if needed).
funcopy () {
if ; then
echo "$2 exists , copying files"
cp -r "$1" "$2"
else
echo "Directory does not exist;Create directory"
mkdir... (1 Reply)
Discussion started by: greet_sed
1 Replies
6. Shell Programming and Scripting
Hi All,
I am new to Unix , there i am facing one problem with sleep command. that is ..
in while loop i have defined sleep function ..
my condition is like this
while #i knew this is infinite loop
do
sleep 200
echo "hello "
done.
this condition will never become .. true... (3 Replies)
Discussion started by: mandlysreedhar
3 Replies
7. Shell Programming and Scripting
Hello, and here's my problem:
I can't get my function to do what I want. When I call my function get_from_A_to_F I give it an argument $remainder. I want my function to substitute a number higher than 9 to a specific letter. If the argument is equal to 10 than it should change it to "A".... (8 Replies)
Discussion started by: linas
8 Replies
8. UNIX for Advanced & Expert Users
Hi,
I have a process which can run one instance at a time. Currently we have multiple scripts trying to kickoff this process. I wanted to implement the semaphore mechanism to achieve this.
I was going through few examples. The below code seems to be reasonable solution.
... (5 Replies)
Discussion started by: tostay2003
5 Replies
9. UNIX for Beginners Questions & Answers
Hello everyone
I really hope you can help me, I can't continue:
Im on a project to work with my Server.
I wanted to put on my server all data-systems and I did this:
df -h
The output is a string.
How can I turn the string into a table?
Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf... (5 Replies)
Discussion started by: anonymuser
5 Replies
10. OS X (Apple)
Hi guys and gals...
I am writing a piece of code that is dash compliant and came across this error.
I have put it in the OSX section as that is what I am using.
I have no idea what the 'dash' version is but was installed about 6 months ago.
MBP, OSX 10.12.6, default terminal running dash on... (4 Replies)
Discussion started by: wisecracker
4 Replies
LEARN ABOUT CENTOS
keyctl_search
KEYCTL_SEARCH(3) Linux Key Management Calls KEYCTL_SEARCH(3)
NAME
keyctl_search - Search a keyring for a key
SYNOPSIS
#include <keyutils.h>
long keyctl_search(key_serial_t keyring, const char *type,
const char *description, key_serial_t destination);
DESCRIPTION
keyctl_search() recursively searches the keyring for a key of the specified type and description.
If found, the key will be attached to the destination keyring (if given), and its serial number will be returned.
The source keyring must grant search permission to the caller, and for a key to be found, it must also grant search permission to the call-
er. Child keyrings will be only be recursively searched if they grant search permission to the caller as well.
If the destination keyring is zero, no attempt will be made to forge a link to the key, and just the serial number will be returned.
If the destination keyring is given, then the link may only be formed if the found key grants the caller link permission and the destina-
tion keyring grants the caller write permission.
If the search is successful, and if the destination keyring already contains a link to a key that matches the specified type and descrip-
tion, then that link will be replaced by a link to the found key.
The source keyring and destination keyring serial numbers may be those of valid keyrings to which the caller has appropriate permission, or
they may be special keyring IDs:
KEY_SPEC_THREAD_KEYRING
This specifies the caller's thread-specific keyring.
KEY_SPEC_PROCESS_KEYRING
This specifies the caller's process-specific keyring.
KEY_SPEC_SESSION_KEYRING
This specifies the caller's session-specific keyring.
KEY_SPEC_USER_KEYRING
This specifies the caller's UID-specific keyring.
KEY_SPEC_USER_SESSION_KEYRING
This specifies the caller's UID-session keyring.
RETURN VALUE
On success keyctl_search() returns the serial number of the key it found. On error, the value -1 will be returned and errno will have been
set to an appropriate error.
ERRORS
ENOKEY One of the keyrings doesn't exist, no key was found by the search, or the only key found by the search was a negative key.
ENOTDIR
One of the keyrings is a valid key that isn't a keyring.
EKEYEXPIRED
One of the keyrings has expired, or the only key found was expired.
EKEYREVOKED
One of the keyrings has been revoked, or the only key found was revoked.
ENOMEM Insufficient memory to expand the destination keyring.
EDQUOT The key quota for this user would be exceeded by creating a link to the found key in the destination keyring.
EACCES The source keyring didn't grant search permission, the destination keyring didn't grant write permission or the found key didn't
grant link permission to the caller.
LINKING
Although this is a Linux system call, it is not present in libc but can be found rather in libkeyutils. When linking, -lkeyutils should be
specified to the linker.
SEE ALSO
keyctl(1),
add_key(2),
keyctl(2),
request_key(2),
keyctl(3),
request-key(8)
Linux 4 May 2006 KEYCTL_SEARCH(3)