07-20-2011
thanks for ur reply Corona688 and michaelrozar17, but i really didnt get what i expected .
ok may be, i will explain little further . i have file thats look like below
Quote:
server1
root:x:0:1:root-/:/sbin/sh
smtp:x:0:0:Mail Daemon User:/:/dev/null
daemon:x:1:1::/:/dev/null
bin:x:2:2::/usr/bin:/dev/null
sys:x:3:3::/:
............
continues..........
server2
root:x:0:1:root-
/:/sbin/shadm:x:4:4:Admin:/var/adm:/dev/null
uucp:x:5:5:uucp Admin:/usr/lib/uucp:/dev/null
nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/dev/null
smmsp:x:25:25:SendMail Message Submission Program:/:/bin/false
.......................
.....................
server3
nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/dev/null
bin:x:2:2::/usr/bin:/dev/null
like that there are nearly 100 servers , i just want to print the user and the servers where account exists.
Quote:
for eg;
user is root then o/p should be
User:root
server1
server2
if user is nuucp o/p should be
user:nuucp
server2
server3
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Gurus,
I have a file say for ex. file1 which has 3500 lines in it which are different account numbers and another file (file2) which has 230000 lines in it. I want to read all the lines in file1 and delete all those lines from file2 which has that same pattern as in file1. I am not quite... (4 Replies)
Discussion started by: toms
4 Replies
2. UNIX for Dummies Questions & Answers
How would I print the word "and" between the words "FOO" and BAR" using sed? My file has three words in it FOO and BAR. I only want the word "and".
Thanks every one. (7 Replies)
Discussion started by: tigta09
7 Replies
3. Shell Programming and Scripting
Hi,
The below code will search a particular string(say false in this case) and return me 10 lines above and below the search string in a file.
" awk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r;print("***********************************");print;c=a;}b{r=$
0}' b=10 a=10 s="false" "
... (5 Replies)
Discussion started by: vimalm22
5 Replies
4. Shell Programming and Scripting
Hi,
I am new to shell scripting and is working on a script to extract lines from a log file between two time stamps using awk command. After some research I used following command:
awk '/01 Oct 2011/{p=1} /10 Oct 2011/{p=0} p' test.log >> tmp.log
This works fine. But now i want to... (3 Replies)
Discussion started by: davidtd
3 Replies
5. Shell Programming and Scripting
I have the following file :
1 2 3 4 5
6 7 8 9 0
9 8 7 6 5
4 3 2 1 0
0 1 2 3 4
Write scripts to
get the following outputs :
A)
1
7
7
1
4 (11 Replies)
Discussion started by: pssooraj72
11 Replies
6. Shell Programming and Scripting
I want to process a file block by block using sed, and if that block does not contain two patterns, then that complete block has to be printed.
See below for the example data.
................................server 1...............................
running process 1
running... (8 Replies)
Discussion started by: Kesavan
8 Replies
7. Shell Programming and Scripting
Hi
I have below script which is used to grep specific errors and if error string matches send an email alert.
Script is working fine , however , i wish to print next 10 lines of the string match to get the details of error in the email alert
Current code:-
#!/bin/bash
tail -Fn0 --retry... (2 Replies)
Discussion started by: neha0785
2 Replies
8. Shell Programming and Scripting
Hi,
I have a file content as below.
Table : PAYR
Displayed fields: 15 of 15 Fixed columns: 4 List width 0999... (4 Replies)
Discussion started by: shirdi
4 Replies
9. Shell Programming and Scripting
im using the following code to search a log for entries on two different lines:
awk 'BEGIN{count=0} /'"${firstpattern}"'/,/'"${secondpattern}"'/ { print; if ($0 ~ /'"${thirdpattern}"'/){count++}; } END { print count }' data.txt
firstpattern="start error log"
secondpattern="i am logging the... (1 Reply)
Discussion started by: SkySmart
1 Replies
10. UNIX for Beginners Questions & Answers
Hi, I need to print lines which are matching with start pattern "SELECT" and END PATTERN ";" and only select the last "select" statement including the ";" .
I have attached sample input file and the desired input should be as:
INPUT FORMAT:
SELECT
ABCD,
DEFGH,
DFGHJ,
JKLMN,
AXCVB,... (5 Replies)
Discussion started by: nani2019
5 Replies
errors(4) Kernel Interfaces Manual errors(4)
NAME
errors - Contains a record of uucico daemon errors
SYNOPSIS
/usr/spool/uucp/.Admin/errors
DESCRIPTION
The /usr/spool/uucp/.Admin/errors file contains a record of uucico daemon errors that the uucp program cannot correct. For example, if the
uucico daemon is unable to access a directory that is needed for a file transfer, the uucp program records this in the errors file. If
debugging is enabled for the uucico daemon, the uucp program sends the error messages to standard output instead of to the errors file.
EXAMPLES
Following is the text of an error that might appear in the errors file: ASSERT ERROR (uucico) pid: 303 (7/18-8:25:09) SYS-
TAT OPEN FAIL /usr/spool/uucp/.Status/ (21) [SCCSID: @(#)systat.c 7.2 87/07/08 16:43:37, FILE: systat.c, LINE:100]
This error occurred on July 18 at 8:25:09 a.m. [(7/18-8:25:09)] when the uucico daemon, running as process 303 [(uucico) pid: 303], could
not open the /usr/spool/uucp/.Status directory [SYSTAT OPEN FAIL /usr/spool/uucp/.Status/]. To prevent this error from occurring again,
you should make sure the permissions for the .Status directory are correct. It should be owned by the uucp login ID and group uucp, with
permissions of 777 (read, write, and execute for owner, group, and all others).
FILES
Contains the errors file and other uucp administrative files Lists the last time a remote system was contacted and the minimum time until
the next retry
RELATED INFORMATION
Commands: uudemon.cleanu(4)
Daemons: uucico(8) delim off
errors(4)