Sponsored Content
Full Discussion: reading lines
Top Forums Shell Programming and Scripting reading lines Post 302414953 by tomjones on Wednesday 21st of April 2010 11:35:58 AM
Old 04-21-2010
reading lines

I want a script that while it read the lines in the file below,it will check if the second variable is greater or equal 10.if less delete the line


tom|2
john|5
simms|23
reed|30
paul|11



After running scripts i should get

simms|23
reed|30
paul|11
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reading lines within vi editor

Hi All, I need to read line by line from a file(created using vi editor) till end of the file and pass it to my own executables so that it will read first line and execute and then other and so on...Thanks The steps are like this; 1) read first line in file 2) execute the job with first line as... (2 Replies)
Discussion started by: asriva26
2 Replies

2. Shell Programming and Scripting

Reading multiple lines as single

Hi, Is it possible to read every 2 lines as single record, I have a file like below, ~CZK ~TSCHECHISCHE KRONE ~TSCHECH. REPUBLIK Dec 1 2005 12:00AM~ 10.840000~ ~DKK ~DAENISCHE KRONE ~DAENEMARK Dec 2 2005 12:00AM~ ... (9 Replies)
Discussion started by: braindrain
9 Replies

3. UNIX for Dummies Questions & Answers

skip reading certain lines in a file

How can I exclude reading lines in a file that contains the following: filesystem:/home/pach/liv_patches 128005120 88456640 37270758 71% /home/patches That is, all lines that contain and begins with filesystem: should not be processed/read from a file (5 Replies)
Discussion started by: paulsew
5 Replies

4. Shell Programming and Scripting

reading lines

Hi all, I have a file whose content I need to read and get the 3rd line .. ex: one two three What I need is to read a content of third line of this file and print first three characters ... I could print first three characters with "head -c 3" if I could get the content of the third line... (4 Replies)
Discussion started by: c0mrade
4 Replies

5. Shell Programming and Scripting

skip lines while reading a file

Hi Experts, I am tryin to read a file and while doing so i need to skip the lines which start with a hash (#) char. I thought of using a goto command but a lot of guys on this site say its not the good way to program. Moreover I am using a ksh shell which deos not support goto command. ... (4 Replies)
Discussion started by: bankimmehta
4 Replies

6. Shell Programming and Scripting

Regarding reading lines into a new file

Hi all, I jut use a loop to read lines from the user and redirect it to a file. echo "Enter the line" while read -r LINE do echo $LINE >> FILE if ;then break fi done input app... (1 Reply)
Discussion started by: Ananthdoss
1 Replies

7. Shell Programming and Scripting

Reading two lines in a while loop and combining the lines

Dear all, I have a file like this: imput scaffold_0 1 scaffold_0 10000 scaffold_0 20000 scaffold_0 25000 scaffold_1 1 scaffold_1 10000 scaffold_1 20000 scaffold_1 23283 and I want the output like this: scaffold_0 1 scaffold_0 10000 scaffold_0 10000 scaffold_0 20000... (6 Replies)
Discussion started by: valente
6 Replies

8. Shell Programming and Scripting

Reading in two lines at once from a text file

Hello everyone, I have thought about this for quite some time and know what I want to do but am having some trouble at it. I have a text file filled with numbers like this, there are more in the file obviously. Each number is separated by a space. 1 3 2 4 5 1 -1 1 0 -1 5The idea is... (7 Replies)
Discussion started by: tastybrownies
7 Replies

9. Shell Programming and Scripting

Csh reading lines

Hi, I have been trying to do a little script in Csh, to classify some information of a text document. My problem appears when i have to calssificate two parts of the same line into different variables, for example in the document appears something like that: ID NAME 999999,Michel... (1 Reply)
Discussion started by: losbirras
1 Replies

10. Shell Programming and Scripting

Reading multiple lines with condition

Hi guys, I need to read following lines and put them in same row …. text: Abcd5437_XYA0_B1_WXYZ_BE 99:00:14:42:55:01:d4:22 99:00:14:42:70:01:d4:22 99:00:14:42:55:03:a0:22 99:00:14:42:70:03:a0:22 ... (4 Replies)
Discussion started by: dc@bos
4 Replies
seccomp_syscall_resolve_name(3) 			     libseccomp Documentation				   seccomp_syscall_resolve_name(3)

NAME
seccomp_syscall_resolve_name - Resolve a syscall name SYNOPSIS
#include <seccomp.h> int seccomp_syscall_resolve_name(const char *name); int seccomp_syscall_resolve_name_arch(uint32_t arch_token, const char *name); char *seccomp_syscall_resolve_num_arch(uint32_t arch_token, int num); Link with -lseccomp. DESCRIPTION
The seccomp_syscall_resolve_name() and seccomp_syscall_resolve_name_arch() functions resolve the commonly used syscall name to the syscall number used by the kernel and the rest of the libseccomp API. The seccomp_syscall_resolve_num_arch() function resolves the syscall number used by the kernel to the commonly used syscall name. The caller is responsible for freeing the returned string from seccomp_syscall_resolve_num_arch(). RETURN VALUE
In the case of seccomp_syscall_resolve_name() and seccomp_syscall_resolve_name_arch() the associated syscall number is returned, with the negative pseudo syscall number being returned in cases where the given syscall does not exist for the architeture. The value __NR_SCMP_ERROR is returned in case of error. In all cases, the return value is suitable for use in any libseccomp API function which requires the syscall number, examples include seccomp_rule_add() and seccomp_rule_add_exact(). In the case of seccomp_syscall_resolve_num_arch() the associated syscall name is returned and it remains the callers responsibility to free the returned string via free(3). EXAMPLES
#include <seccomp.h> int main(int argc, char *argv[]) { int rc = -1; scmp_filter_ctx ctx; ctx = seccomp_init(SCMP_ACT_KILL); if (ctx == NULL) goto out; /* ... */ rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, seccomp_syscall_resolve_name("open"), 0); if (rc < 0) goto out; /* ... */ rc = seccomp_load(ctx); if (rc < 0) goto out; /* ... */ out: seccomp_release(ctx); return -rc; } NOTES
While the seccomp filter can be generated independent of the kernel, kernel support is required to load and enforce the seccomp filter gen- erated by libseccomp. The libseccomp project site, with more information and the source code repository, can be found at http://libseccomp.sf.net. This library is currently under development, please report any bugs at the project site or directly to the author. AUTHOR
Paul Moore <paul@paul-moore.com> SEE ALSO
seccomp_rule_add(3), seccomp_rule_add_exact(3) paul@paul-moore.com 7 January 2013 seccomp_syscall_resolve_name(3)
All times are GMT -4. The time now is 12:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy