I am new to shell programming. Can anyone help me out with anyone of these?
Display a count of the number of regular files, the number of symbolic links, the number of sub-directories, the number of block-special files, and the number of character-special files in the directory.
I don't... (4 Replies)
Hi forum. I am fairly new to scripting and use a simple script to process e-mails for my work. These e-mails contain a list of IPv4 IPs that I process and seperate into text files, which are then attached to a larger, 'digest' e-mail. I also put some of the output from the text files into the... (4 Replies)
Hi there,
I'd like to find a way to display a string and count the words in it.
supernova:~# echo 'hello world' | tee - | wc
Unfortunately, this doesn't work.
Any idea?
Thanks in advance.
Santiago (15 Replies)
guys,
I am new shelll scripting..
this a question on passt exam paper, I was trying to solve it , I can not.
the question is as follow?
a. Write a shell script to count the number of accounts which belong to particular primary group in a standard UNIX system which uses local... (1 Reply)
I have a sorted file like:
Apple 3
Apple 5
Apple 8
Banana 2
Banana 3
Grape 31
Orange 7
Orange 13
I'd like to search $1 and if $1 is not the same as $1 in the previous row print that row and print the number of times $1 was found.
so the output would look like:
Apple 8 3
Banana... (2 Replies)
Hi Mates,
I require help in the following:
I have the following file snmp.txt
Wed Mar 2 16:02:39 SGT 2011
Class : mmTrapBladeS
origin : 10.0.0.0
hostname : 10.0.0.2
msg : IBM Blade Alert:
Calendar Index : 10.0.0.2-IBMBLADE
Fri Mar 4 07:10:54 SGT 2011
Class : mmTrapBladeS... (2 Replies)
Hello everyone,
I am new to Unix and I am stuck with a problem. I need only a single command to display the output of who and then add the total number of users and display at the bottom of that output.
Example-: (Expected output)
sreyan@debian:~$ <command>
sreyan tty7 ... (7 Replies)
What I'm trying to accomplish. I receive a Header and Detail file for daily processing. The detail file comes first which holds data, the header is a receipt of the detail file and has the detail files record count. Before processing the detail file I would like to put a wrapper around another... (4 Replies)
Hi,
I have been frantically googling and checking some sqlplus forums, but can't find the correct syntax.
Basically within sqlplus I want to do a count on a table and if the count is 0 it displays 0 instead of "no rows found".
For eample:
select count(*) from tableA where... (3 Replies)
Discussion started by: chris01010
3 Replies
LEARN ABOUT OSF1
uniq
uniq(1) General Commands Manual uniq(1)NAME
uniq - Removes or lists repeated lines in a file
SYNOPSIS
Current Syntax
uniq [-cdu] [-f fields] [-s chars] [input-file [output-file]]
Obsolescent Syntax
uniq [-cdu] [-fields] [+chars] [input-file [output-file]]
The uniq command reads from the specified input_file, compares adjacent lines, removes the second and succeeding occurrences of a line, and
writes to standard output.
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
uniq: XCU5.0
Refer to the standards(5) reference page for more information about industry standards and associated tags.
OPTIONS
Precedes each output line with a count of the number of times each line appears in the file. This option supersedes the -d and -u options.
Displays repeated lines only. Ignores the first fields fields on each input line when doing comparisons, where fields is a positive deci-
mal integer. A field is the maximal string matched by the basic regular expression:
[[:blank:]]*[^[:blank:]]*
If the fields argument specifies more fields than appear on an input line, a null string is used for comparisons. Ignores the spec-
ified number of characters when doing comparisons. The chars argument is a positive decimal integer.
If specified with the -f option, the first chars characters after the first fields fields are ignored. If the chars argument speci-
fies more characters than remain on an input line, uniq uses a null string for comparison. Displays unique lines only. Equivalent
to -f fields. (Obsolescent) Equivalent to -s chars. (Obsolescent)
OPERANDS
A pathname for the input file.
If this operand is omitted or specified as -, then standard input is read. A pathname for the output file.
If this operand is omitted, then standard output is written.
DESCRIPTION
The input_file and output_file arguments must be different files. If the input_file operand is not specified, or if it is -, uniq uses
standard input.
Repeated lines must be on consecutive lines to be found. You can arrange them with the sort command before processing.
EXAMPLES
To delete repeated lines in the following file called fruit and save it to a file named newfruit, enter: uniq fruit newfruit
The file fruit contains the following lines:
apples apples bananas cherries cherries peaches pears
The file newfruit contains the following lines:
apples bananas cherries peaches pears
EXIT STATUS
The following exit values are returned: Successful completion. An error occurred.
ENVIRONMENT VARIABLES
The following environment variables affect the execution of uniq: Provides a default value for the internationalization variables that are
unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari-
ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value,
overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes
of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the locale for the for-
mat and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of
LC_MESSAGES.
SEE ALSO
Commands: comm(1), sort(1)
Standards: standards(5)uniq(1)