Sponsored Content
Top Forums Shell Programming and Scripting File comparison in shell script Post 302503232 by kiran_j on Thursday 10th of March 2011 03:31:29 AM
Old 03-10-2011
File comparison in shell script

Hi,

I have written one script :

Code:
#!/bin/bash

echo -n -e "\nEnter how many files : "
read no

for (( j=1; j<=$no; j++ ))
do
    echo -n -e "\nEnter $j File name : "
    read name[$j]
done

for (( j=1; j<=$no; j++ ))
do
    FILE=`find ./ -type f -name "${name[$j]}"`
    echo "$FILE"
done

Output:

Enter how many files : 2

Enter 1 File name : word.sh

Enter 2 File name : dfile.sh

./word/word.sh
./word.sh
./dfile.sh

I need script that should print "word.sh file present in multiple path"
so how do i compare "word.sh" ????
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with time comparison shell script for HP-UX

I am using Korne Shell in HP-Ux. Can someone give me and idea on how I can write a shellscript on how to do this please:- On our HP-UX server, a batch file is run every evening at about 6:30pm. The first step of this batch file will touch an empty "flag" file to indicate that the batch has... (6 Replies)
Discussion started by: gummysweets
6 Replies

2. Shell Programming and Scripting

file comparison script

Hi I need to write a script that can check files in a folder one by one and compare against a fixed file. i.e. I have some files in folder_a file1.txt file2.txt file3.txt and a fixed file in folder_b fixed.txt Inside the fixed.txt, I have line1.sql line2.sql line3.sql Inside the... (1 Reply)
Discussion started by: tiger99
1 Replies

3. Shell Programming and Scripting

bash shell script string comparison

I want to remove a line that has empty string at second field when I use cut with delimeter , like below $cat demo hello, mum hello, #!/bin/sh while read line do if then # remove the current line command goes here fi done < "demo" i got an error message for above... (4 Replies)
Discussion started by: bonosungho
4 Replies

4. Shell Programming and Scripting

need help in writing a comparison shell script

I have a folder a1 with the following files sample_1.log sample_2.log sample_3.log sample_4.log sample_5.log sample_6.log In another folder there is a file b with the value 5 My script should take the value 5 ( file b), compare it with the files in folder a1, if file name contains... (1 Reply)
Discussion started by: Nagesh1
1 Replies

5. Shell Programming and Scripting

How to do row comparison in shell script

Hi, I need help on doing the below thing in shell script. I have a file with millions of rows called "abc.txt". i have another file with millions of rows called "xyz.txt". I would like to do the below operation. Open the abc.txt, read the first line, do some operations on the column... (2 Replies)
Discussion started by: informsrini
2 Replies

6. Solaris

String Comparison in Shell script

I Have a script which gets the status of oracle database and if the status is READ WRITE ..it should echo "db is up " else "db is down" Here is the code if then echo "db up" else echo "db down" fi done; The script is giving me out put "db down" even thoug the value of... (6 Replies)
Discussion started by: njafri
6 Replies

7. Shell Programming and Scripting

"Help with comparison shell script"

Hi, I have a script which uses SQL to take the contents of a DB table and saves the contents to two text files one contains the headers of the DB and the other contains the contents of the DB. These files are stored in directorys that are named dependent upon the current date i.e. 20110305. ... (1 Reply)
Discussion started by: snow1
1 Replies

8. Shell Programming and Scripting

Korn shell script comparison

I have a scenario to implement in Korn shell script. Here it is.. I need to compare two values to see whether they are same or not. The issue is that the values coming in for comparison can be a string or an integer which can be determined during run time only. Which korn shell comparison... (1 Reply)
Discussion started by: vani123
1 Replies

9. Shell Programming and Scripting

Date and Time comparison using shell script

Hi, I'm having two fields in the file F1|F2 20111220|102000 F1 ->YYYYMMDD F2 ->HHMMSS Now, I need to compare this with current date & time and need to return the difference value in hours. Already, I checked with datecalc from the forum. So, need hints from Shell Gurus. Thanks (10 Replies)
Discussion started by: buzzusa
10 Replies

10. Shell Programming and Scripting

Please hel me with file comparison script

Hi All, I have two files(file1.txt and file2.txt) and also file names which are presented in the files also present in the directory gdir/db/files. file1.txt /db/day_files/data_feed20161231 /db/day_files/data_feed20161229 /db/day_files/data_feed20161125... (1 Reply)
Discussion started by: PAPAS
1 Replies
gst-complete-0.8(1)						   User Commands					       gst-complete-0.8(1)

NAME
gst-complete-0.8, gst-complete - perform bash completion for gst-launch command lines SYNOPSIS
complete -Cgst-complete-0.8 gst-launch gst-complete [--gst-list-mm] [--gst-mm=string] [--print] DESCRIPTION
gst-complete-0.8 enables bash to provide context-sensitive tab completion for gst-launch command lines. See gst-launch(1) for the syntax of gst-launch command lines. You must have a version of bash that supports programmable completion. Such versions of bash provide the complete built-in command. gst-complete is a wrapper script that runs the latest installed version of gst-complete-X.X. For example, if both gst-complete-0.7 and gst- complete-0.8 are installed on your system, gst-complete runs gst-complete-0.8. OPTIONS
The following options are supported by gst-complete-0.8 and gst-complete: --help Display detailed usage message. You can also use -? to specify this option. The following options are supported by gst-complete only: --gst-list-mm List found major/minor versions. This option displays the versions that are available. --gst-mm=string Force major/minor version. This option enables you to specify a specific version to run, if you do not want to run the default version. --print Print wrapped command line. This option displays the command that will be run, and then runs the command. EXAMPLES
Example 1: Generating the Registry of Available Plugins by Running gst-compprep Run the following command in your .bash_profile or other appropriate place: example% complete -C gst-complete-0.8 gst-launch Example 2: Running the Wrapper Script and Displaying the Command Name example% gst-complete --print /usr/bin/gst-complete-0.8 FILES
The following files are used by this application: /usr/bin/gst-complete-0.Executable for bash completion for gst-launch /usr/bin/gst-complete Wrapper script that runs the latest installed version of gst-complete-X.X ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-media | +-----------------------------+-----------------------------+ |Interface stability |External | +-----------------------------+-----------------------------+ SEE ALSO
gst-compprep(1), gst-feedback(1), gst-inspect(1), gst-launch(1), gst-launch-ext(1), gst-md5sum(1), gst-register(1), gst-thumbnail(1), gst- typefind(1), gst-xmlinspect(1), gst-xmllaunch(1), gstreamer-properties(1), libgstreamer-0.8(3), libgstgetbits(3) NOTES
Original man page written by the GStreamer team at http://gstreamer.net/. Updated by Brian Cameron, Sun Microsystems Inc., 2004. SunOS 5.10 14 Oct 2004 gst-complete-0.8(1)
All times are GMT -4. The time now is 04:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy