hi,
how would i go about making a loop which gets each line from a single text file, set it to a variable and then print it to screen?
thanks
eg:
#!/bin/sh
FILE="somefile.txt"
text_line=""
what kind of loop would use here? (18 Replies)
Hi all
Sorry for the basic question, but i am writing a shell script to get around a slightly flaky binary that ships with one of our servers. This particular utility randomly generates the correct information and could work first time or may work on the 12th or 100th attempt etc !.... (4 Replies)
I'm improving the way an existing script handles arrays, but the results aren't what I had in mind:
e="Too many consecutive errors... System is probably unstable!"
e="Cancelable Timer Wait Failed!"
for errcd in ${e}
do
echo ${errcd}
done
The for loop interprets the spaces... (2 Replies)
hey guys what im trying to do is do a simple script that will ask for a password and on the 5th time it says access denied if the right password is still not entered this is what i have so far can anyone help me im not good with scripting
thanks in advance
#!/bin/bash
secretname=secret... (2 Replies)
I am struggling with the for loop. I have a file name heros.txt and I would like to go through a list in file where.txt and see if I can find the name from where inside heros.
One of the problems that I am having is I dont understand how to setup the for loop to find the list to search.:wall:
... (6 Replies)
Hi,
I'm trying to put together a small script that will read a txt file that contains a list of two columns. Each column is the name of a folder..
e.g.
AIX Server1
AIX Server2
AIX Server3
$ for i in `cat /opt/apacheprod/scripts/input/copy_list.txt`
do
PLATFORMVAR=`awk ' { print $1 } '... (7 Replies)
I have two files. In file one, there are many columns, but only two of interest to me. Column 1 contains a list of individuals, defined by an ID number. Column 10 contains the diagnosis that each individual has (I am a physician). All together, there are 3000 lines in this file, one line per... (2 Replies)
Hi,
I have a requirement where I have to check for 10 files in Unix location. If all of the files present in that directory then i have execute another process.
can you help me resolving this issue.
sample
location
/home/usr
abc.txt
cde.txt
aaaa.txt
lll.txt
ooo.txt
if all the... (3 Replies)
Hi,
I have code like below
disk_list=$(ls /root/file1)
for disk in $disk_list
do
pvcreate $i
done
I know what pvcreate command does, but I do not understand what this $i do here. can someone please explain. (2 Replies)
Discussion started by: stew
2 Replies
LEARN ABOUT DEBIAN
get_robust_list
GET_ROBUST_LIST(2) Linux System Calls GET_ROBUST_LIST(2)NAME
get_robust_list, set_robust_list - get/set list of robust futexes
SYNOPSIS
#include <linux/futex.h>
#include <syscall.h>
long get_robust_list(int pid, struct robust_list_head **head_ptr,
size_t *len_ptr);
long set_robust_list(struct robust_list_head *head, size_t len);
Note: There are no glibc wrappers for these system calls; see NOTES.
DESCRIPTION
The robust futex implementation needs to maintain per-thread lists of robust futexes which are unlocked when the thread exits. These lists
are managed in user space; the kernel is only notified about the location of the head of the list.
The get_robust_list() system call returns the head of the robust futex list of the thread whose thread ID is specified in pid. If pid is
0, the head of the list for the calling thread is returned. The list head is stored in the location pointed to by head_ptr. The size of
the object pointed to by **head_ptr is stored in len_ptr.
The set_robust_list() system call requests the kernel to record the head of the list of robust futexes owned by the calling thread. The
head argument is the list head to record. The len argument should be sizeof(*head).
RETURN VALUE
The set_robust_list() and get_robust_list() system calls return zero when the operation is successful, an error code otherwise.
ERRORS
The set_robust_list() system call can fail with the following error:
EINVAL len does not match the size of structure struct robust_list_head expected by kernel.
The get_robust_list() system call can fail with the following errors:
EPERM The calling process does not have permission to see the robust futex list of the thread with the thread ID pid, and does not have
the CAP_SYS_PTRACE capability.
ESRCH No thread with the thread ID pid could be found.
EFAULT The head of the robust futex list can't be stored at the location head.
VERSIONS
These system calls were added in Linux 2.6.17. No library support is provided; use syscall(2).
NOTES
These system calls are not needed by normal applications. No support for them is provided in glibc. In the unlikely event that you want
to call them directly, use syscall(2).
A thread can have only one robust futex list; therefore applications that wish to use this functionality should use the robust mutexes pro-
vided by glibc.
SEE ALSO futex(2)
Documentation/robust-futexes.txt and Documentation/robust-futex-ABI.txt in the Linux kernel source tree
COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2012-07-13 GET_ROBUST_LIST(2)