06-07-2017
Hi nans,
RudiC's code and my code are intended to do different things.
My code processes all of the .vcf file in the current working directory and prints the name of the file and the ID found for each file in which the filename and the ID do not match.
RudiC's code processes one file at a time. If the filename and the ID in that file match, the exit code will be 0; if the filename and the ID do not match, the exit code will be 1. No output is printed either way, you just use the exit code of the script as a test to determine whether or not that file meets your expectations.
This User Gave Thanks to Don Cragun For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
In my script I am trying to input data from user and I want the promt to appear again if the input data is not the one expected.
I tried something like this:
echo " \n\n\t Enter the dump filename:\c";read dump
pst=${dump##*.}
until (test $pst = dmp)
do
... (7 Replies)
Discussion started by: Sreejith_VK
7 Replies
2. Shell Programming and Scripting
Hi, im have log file ~100000 lines,
192.168.29.1 at 10/08/09 13:58:55
192.168.60.1 at 10/08/09 14:11:28
192.168.58.171 at 10/08/09 14:12:45
192.168.61.12 at 10/08/09 14:15:44
192.168.60.1 at 10/08/09 14:16:36
192.168.60.1 at 10/08/09 14:17:43
192.168.61.12 at 10/08/09 14:18:08... (9 Replies)
Discussion started by: Trump
9 Replies
3. Shell Programming and Scripting
Hi
I have files with names that contain the date in several formats as, YYYYMMDD, DD-MM-YY,DD.MM.YY or similar combinations.
I know if a file fits in one pattern or other, but i donīt know how to extract the substring contained in the file that matches the pattern.
For example, i know that
... (1 Reply)
Discussion started by: pjrm
1 Replies
4. Solaris
I know how to check if any file has a unix process using a file by looking at 'lsof <fullpath/filename>' command.
I think using lsof is very expensive. Also to make it accurate we need to inlcude fullpath of the file.
Is there another command that can tell if a file has a truely active... (12 Replies)
Discussion started by: kchinnam
12 Replies
5. Shell Programming and Scripting
Hi All
I have a rather large text file of approx 1m records in the format:-
20110877837-2.PDF
20100298984-3.PDF
et al...
I want to run uniq against the file to make sure there are no duplicate names.....
uniq -d /path/to/input/file.txt
However this is not producing any... (1 Reply)
Discussion started by: Bashingaway
1 Replies
6. UNIX for Dummies Questions & Answers
I am using grep to match a pattern, but the output is strange.
$ grep -r -o "pattern" *
Gives me:
Binary file foo1 matches
Binary file foo2 matches
Binary file foo3 matches
To find the lines before/after, I then have to use the following on each file:
$ strings foo1 | grep -A1 -B1... (0 Replies)
Discussion started by: chipperuga
0 Replies
7. Shell Programming and Scripting
Hi,
I am trying to write a script where I need to pull any file if the date is from yesterday. Can you please help me on how to check the dates for the files on the remote server?
Please let me know for any questions.
Thanks
Ajay (4 Replies)
Discussion started by: ajayakunuri
4 Replies
8. Shell Programming and Scripting
i had requirement like i need to get "error" line of above 3 and below 3 from a file .I tried with the below script.But it's not working.
y='grep -n -i error /home/file.txt|cut -c1'
echo $y
head -$y /home/file.txt| tail -3 >tmp.txt
tail -$y /home/file.txt head -3 >>tmp.txt (4 Replies)
Discussion started by: bhas85
4 Replies
9. Shell Programming and Scripting
I have a file comp.pkglist which mention package version and release . In 'version change' and 'release change' line there are two versions 'old' and 'new' Version Change: --> Release Change: -->
cat comp.pkglist
Package list: nss-util-devel-3.28.4-1.el6_9.x86_64
Version Change: 3.28.4 -->... (1 Reply)
Discussion started by: Paras Pandey
1 Replies
10. Shell Programming and Scripting
hi all,
trying this using shell/bash with sed/awk/grep
I have two files, one containing one column, the other containing multiple columns (comma delimited).
file1.txt
abc12345
def12345
ghi54321
...
file2.txt
abc1,text1,texta
abc,text2,textb
def123,text3,textc
gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
IGAWK(1) Utility Commands IGAWK(1)
NAME
igawk - gawk with include files
SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ...
igawk [ all gawk options ] [ -- ] program-text file ...
DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1).
AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like
@include getopt.awk
in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path.
OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports.
EXAMPLES
cat << EOF > test.awk
@include getopt.awk
BEGIN {
while (getopt(ARGC, ARGV, "am:q") != -1)
...
}
EOF
igawk -f test.awk
SEE ALSO
gawk(1)
Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995.
AUTHOR
Arnold Robbins (arnold@skeeve.com).
Free Software Foundation Nov 3 1999 IGAWK(1)