Sponsored Content
Top Forums Shell Programming and Scripting Keeping the title of a text report Post 302367384 by mkastin on Monday 2nd of November 2009 11:47:14 AM
Old 11-02-2009
Code:
uniq -u input > output

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Keeping the format ...

Hi all, Am trying to execute a loop but having some troubles... Files that will be query'd use the Julian date (eg: cpu032, cpu365) in their naming convention. I'm a little lost how to maintain the three character format of the numeric portion of the file name while cycling backwards(or... (13 Replies)
Discussion started by: Cameron
13 Replies

2. Solaris

keeping history of command

hi can anyone tell me how or where to set to enable history of command keyed in to be logged? so that it can be used or traced later. thanks (3 Replies)
Discussion started by: legato
3 Replies

3. UNIX for Dummies Questions & Answers

house keeping script

Hi, I am not aware whether any one has posted this early or not. I am creating a house keeping script in which I give the user two options: 1. creating a zip file. 2. removing all files given by user. Before taking any action I am asking user to enter full path of file or files to be... (7 Replies)
Discussion started by: Rakesh Bhat
7 Replies

4. Shell Programming and Scripting

In PHP replacing text between TAGS & URI information in Title Tag

Hi, what I am trying to do in PHP, is to replace the Title. I need some of the URL information inside aswell depending on the domain. The title is always different so I need to store it in a variable, put the url info like described below in front of it. Here is an example how it should... (0 Replies)
Discussion started by: lowmaster
0 Replies

5. Shell Programming and Scripting

Keeping last part

Hello, Sorry for the poor tilte but I still don't know how to this. Here is my problem. I have to huge log file. In this log file I can know where is stored all my files. As I have to get a reporting of of files I only need to keep the file name but I don't know how to do it. I hope you... (5 Replies)
Discussion started by: Aswex
5 Replies

6. Shell Programming and Scripting

Keeping the number intact

Currently I have the following to separate the numeric values. However the decimal point get separated. ls -lrt *smp*.cmd | awk '{print $NF}' | sed 's/^.*\///' | sed 's/\(*\)/ & /g' As an example on the files n02-z30-dsr65-terr0.50-dc0.05-4x3smp.cmd... (8 Replies)
Discussion started by: kristinu
8 Replies

7. Shell Programming and Scripting

Create a report for client with a text data file

Hi, I am an amateur bash scriptwriter and I need to write a script which creates a report in a formatted, easy to read table-like that is displayed to standard output. The script has to export the followings: Process ID,User Name, Command Name,Priority..... Now I have a file that I can see all... (3 Replies)
Discussion started by: bashily
3 Replies

8. Shell Programming and Scripting

Need to sort text keeping first line always first

I have a file is created from standard output. I have put a leading space to force the first line to collate low vis a vis the rest of the lines. If I pass the entire file to the Linux sort, it ignores the leading space and the first line appears in somewhere in the list. If I add lots of... (15 Replies)
Discussion started by: lsatenstein
15 Replies

9. Shell Programming and Scripting

Convert text between exact matching patterns to Title case

Hi Folks, I have a large text file with multiple similar patterns on each line like: blank">PATTERN1 some word PATTERN2 title=">PATTERN1 some word PATTERN2 blank">PATTERN1 another word PATTERN2 title=">PATTERN1 another word PATTERN2 blank">PATTERN1 one more time PATTERN2 title=">PATTERN1... (10 Replies)
Discussion started by: martinsmith
10 Replies

10. Post Here to Contact Site Administrators and Moderators

Newbie reports: some posts show only the title and bottom-of-page menu. No text in the middle!

When I try to look at some of the posts (like "Rookie Grandmother"), I see the thread title and the menu at the bottom, but not the text of the post in the middle. I can see ALL of the posts in the Recent menu, but NONE of the others. The screenshot I attached shows the situation. I just... (2 Replies)
Discussion started by: JRWoodward
2 Replies
uniq(1) 						      General Commands Manual							   uniq(1)

Name
       uniq - report repeated lines in a file

Syntax
       uniq [-udc[+n][-n]] [input[output]]

Description
       The  command  reads  the  input	file comparing adjacent lines.	In the normal case, the second and succeeding copies of repeated lines are
       removed; the remainder is written on the output file.  Note that repeated lines must be adjacent in order to be found.  For further  infor-
       mation, see

Options
       The n arguments specify skipping an initial portion of each line in the comparison:

       -n Skips specified number of fields.  A field is defined as a string of non-space, non-tab characters separated by tabs and spaces from its
	  neighbors.

       +n Skips specified number of characters in addition to fields.  Fields are skipped before characters.

       -c Displays number of repetitions, if any, for each line.

       -d Displays only lines that were repeated.

       -u Displays only unique (nonrepeated) lines.

       If the -u flag is used, just the lines that are not repeated in the original file are output.  The -d option specifies  that  one  copy	of
       just the repeated lines is to be written.  The normal mode output is the union of the -u and -d mode outputs.

       The  -c option supersedes -u and -d and generates an output report in default style but with each line preceded by a count of the number of
       times it occurred.

See Also
       comm(1), sort(1)

																	   uniq(1)
All times are GMT -4. The time now is 02:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy