Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Iterate through a list - checking for a duplicate then report it ot Post 303036912 by worky on Wednesday 17th of July 2019 04:12:35 AM
Old 07-17-2019
Iterate through a list - checking for a duplicate then report it ot

I have a job that produces a file of barcodes that gets added to every time the job runs
I want to check the list to see if the barcode is already in the list and report it out if it is.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Report of duplicate files based on part of the filename

I have the files logged in the file system with names in the format of : filename_ordernumber_date_time eg: file_1_12012007_1101.txt file_2_12022007_1101.txt file_1_12032007_1101.txt I need to find out all the files that are logged multiple times with same order number. In the above eg, I... (1 Reply)
Discussion started by: sudheshnaiyer
1 Replies

2. Shell Programming and Scripting

Duplicate Line Report per Section

I've been working on a script (/bin/sh) in which I have requested and received help here (in which I am very grateful for!). The client has modified their requirements (a tad), so without messing up the script to much, I come once again for assistance. Here are the file.dat contents: ABC1... (4 Replies)
Discussion started by: petersf
4 Replies

3. Shell Programming and Scripting

iterate through list of numbers and print specific lines with awk

Could someone please point me in the right direction with the following? I have a program that generates logs that contains sections like this: IMAGE INPUT 81 0 0.995 2449470 0 1726 368 1 0.0635 0.3291 82 0 1.001 2448013 0 1666 365 1 0.0649 ... (4 Replies)
Discussion started by: euval
4 Replies

4. UNIX for Dummies Questions & Answers

report duplicate

Hi i have a file with one column and want to report the value that has duplicate like rag rag hi hi hi 123 456 output should be rag hi thank you (6 Replies)
Discussion started by: thonlun
6 Replies

5. Shell Programming and Scripting

How to loop(Iterate) through List with foreach(csh)

Hey all,, I know cshell is harmful:) but I am using this just "to know" - for educational purposes!... not for a long-term use. lets say i have a list.. set arr=(x y z e f) I wanna iterate the list with foreach ,, not with while.!! foreach i $arr echo $i end does not work (2 Replies)
Discussion started by: eawedat
2 Replies

6. Shell Programming and Scripting

checking duplicate entry in file

Hi i have a file like 110.10 120.10 -1120 110.10 and the lines are having more than 10k. do we have anycommand to check the duplicate entries in the file. I applied the while loop by greping each line with whole file, but it is taking huge amount of time as the file size is large. ... (5 Replies)
Discussion started by: saluja.deepak
5 Replies

7. UNIX for Dummies Questions & Answers

Nested for loops for checking duplicate files

I am very new to bash scripting and this is my first script. I am trying to write a script that takes an argument d as the directory. It looks through the files to find duplicates and delete them. Here's some sorta-pseudocode but am unsure how to implement it: #! /bin/bash #get... (1 Reply)
Discussion started by: shubham92
1 Replies

8. Shell Programming and Scripting

Checking for duplicate code

I have a short line of code that checks very rudimentary for duplicate code: sort myfile.cpp | uniq -c | grep -v "^.*1 " | grep -v "}" It sorts the file, counts occurrences of each line, removes single occurrences and removes the ubiquitous closing brace. The language is C++, but is easily... (3 Replies)
Discussion started by: figaro
3 Replies

9. UNIX for Dummies Questions & Answers

Iterate/Loop Through XML Node List

I need to load an XML file and loop through a list of nodes in it to execute a shell script for each one using the attributes for each node as parameters for the script. Any ideas? Any help will be much appreciated. (1 Reply)
Discussion started by: bradlecat
1 Replies

10. Shell Programming and Scripting

REMOVE DUPLICATE IN a ROW AFTER CHECKING THE FIRST SIMILAR NAME

Hi all I have a big file like this in rows and columns from 2 column onwards the next column is desciption of previous column means 3rd columns is description of 2 columns and 5 column is description of 4 column. All cloumns are separated by comma ... (1 Reply)
Discussion started by: manigrover
1 Replies
TGTIMG(8)																 TGTIMG(8)

NAME
tgtimg - Linux SCSI Target Framework Image File Utility SYNOPSIS
tgtimg [-o --op <operation>] [-Y --device-type <device-type>] [-b --barcode <barcode>] [-s --size <size>] [-t --type <media-type>] [-f --file <path>] tgtimg --help DESCRIPTION
Tgtimg is a utility to create and manage the image files used by the TGTD device emulation. This command is used to initialize device image files with the additional metadata, such as barcode, list of blocks, total size, etc that the TGTD emulation needs. OPTIONS
-h, --help Show a help screen and exit. -o, --op {new|show} Operation. Is either new to create a new image file or show to show the content of an existing image file. -Y, --device-type <type> This specifies the type of image file. Supported device types are : cd : to create media for a dvd device disk : to create media for a disk device tape : to create media for a tape device -t, --type <media-type> When creating a new image, this specifies the type of media to emulate. The available mediatypes depend on the type of the device. Supported media types for cd devices are : dvd+r : create a blank writeable DVD+R disk Supported media types for disk devices are : disk : create an empty disk Supported media types for tape devices are : data : create a normal data tape clean : create a cleaning tape worm : create a worm -b, --barcode <barcode> When creating a new image, this argument specifies the barcode to use with this image file. Backup application software often uses barcodes to identify specific tapes. When emulating a VTL, make sure that all tape images use unique barcodes. -s, --size <size> When creating a new image, this specifies the size in megabytes for the virtual tape image. -f, --file <path> The filename of the image file. EXAMPLES
To create a new 100MByte disk tgtimg --op new --device-type disk --type disk --size 100 --file /data/hd001.raw To create a new tape image tgtimg --op new --device-type tape --barcode 12345 --size 100 --type data --file /data/tape001.img To view the content of an existing image tgtimg --op show --device-type tape --file /data/tape001.img To create a new blank DVD+R image tgtimg --op new --device-type cd --type dvd+r --file /data/dvd001.iso SEE ALSO
tgtd(8), tgtadm(8), tgt-admin(8), tgt-setup-lun(8). http://stgt.sourceforge.net/ REPORTING BUGS
Report bugs to <stgt@vger.kernel.org> 04/04/2010 TGTIMG(8)
All times are GMT -4. The time now is 08:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy