Hello all,
I need to run snoop command for a period of time (a day) and extract remote host column from it to find out who is accessing my server. When I run the following on the command line it works
snoop -port 22 | awk '{print $3}'
but when I do
snoop -port 22 | awk '{print $3}' | while... (2 Replies)
Dear friends,
i am writing csh script
i have one dat file containing following data.like this.
08FD3 03A26 000FA0 FFFF0 BBA0F 00000 00000
from the above file i want to read each letter and store it in one variable.
how it is possible.
please help (7 Replies)
Hi all,
I'm quite new to unix and hope that someone can help me on this.
I'm using csh.
Below is what i intend to do.
1. I stored some data in a file.
2. I intend to read the file line by line and store each line of data into a variable, so that i can used it later.
Anyone have any... (4 Replies)
Hi,
How to read a file and put the values in a script. E.g.
file1.txt
02/12/2009;t1;t2
The script should read this file and put these values in 3 different variables x1,x2,x3 which can be used further.
Thanks
Ashu (3 Replies)
Hi Gurus,
I am trying for a scenario where in I want to read the contents of a file line by line and then store them in variables. Below is the script:
#!/bin/ksh
while read line
do
id=`echo $line | cut -f1 -d |`
name=`echo $line | cut -f2 -d |`
echo $id
... (11 Replies)
Hi,
when I enter 'ps -ef| grep process_name'/'psu | grep process_name', i am getting multiple number of lines output( i mean multiple no of processes).how can i store it one by one and echo it in the same way(one by one).
part of script is
var1=$(remsh hostname -l username ps -ef|grep... (2 Replies)
I am reading a value from a file and want to store the value in a dynamic array as i don't know the number of occurrences of the value in that file.
How can i do that and then later fetch that value from array (25 Replies)
I have a input file like this.
Sample.txt
30 | TXDatacenter | TXBackupDC
10 | UKDatacenter | UKBackupDC
0 | NLDatacenter | NLBackupDC
......
......
......
I need to get these values in different variables like this.
Load1=30
PriCenter1=TXDatacenter... (5 Replies)
Hi,
I have a file service.xml which has following content:
<?xml version="1.0" encoding="UTF-8"?>
<Service Ver="2.31.13"/>
I want to read the value of Ver (that is 2.31.13) and assign to a variable which i further use.
Please help me in that. (3 Replies)
Discussion started by: laxmikant15
3 Replies
LEARN ABOUT REDHAT
strsep
STRSEP(3) Linux Programmer's Manual STRSEP(3)NAME
strsep - extract token from string
SYNOPSIS
#include <string.h>
char *strsep(char **stringp, const char *delim);
DESCRIPTION
If *stringp is NULL, the strsep() function returns NULL and does nothing else. Otherwise, this function finds the first token in the string
*stringp, where tokens are delimited by symbols in the string delim. This token is terminated with a ` ' character (by overwriting the
delimiter) and *stringp is updated to point past the token. In case no delimiter was found, the token is taken to be the entire string
*stringp, and *stringp is made NULL.
RETURN VALUE
The strsep() function returns a pointer to the token, that is, it returns the original value of *stringp.
NOTES
The strsep() function was introduced as a replacement for strtok(), since the latter cannot handle empty fields. However, strtok() con-
forms to ANSI-C and hence is more portable.
BUGS
This function suffers from the same problems as strtok(). In particular, it modifies the original string. Avoid it.
CONFORMING TO
BSD 4.4
SEE ALSO index(3), memchr(3), rindex(3), strchr(3), strpbrk(3), strspn(3), strstr(3), strtok(3)GNU 1993-04-12 STRSEP(3)