Sponsored Content
Top Forums Shell Programming and Scripting Simply Bash Script to Confirm that there are 2 Files in Same Folder Post 303027606 by valdez on Thursday 20th of December 2018 07:04:05 AM
Old 12-20-2018
hehe, no i dont use linux for almost 10 years now.

thx for your answer, but still same result:


Code:
XXX:[XXX]/voip/old # find ./ -name 'unavail.wav' -o -name 'unavail.WAV' -printf '%#m %u %h\n'
0644 root ./7325
0644 root ./6657
0700 root ./2309
0644 root ./5863
0700 root ./3339
0644 root ./4045
0700 root ./96964
0644 root ./5867
0700 root ./3336
0644 root ./98764
0700 root ./33010
0644 root ./5891
0644 root ./2312
0644 root ./2057
0700 root ./2352
0644 root ./5861
0644 root ./7322
0644 root ./7332
0700 root ./8336
0700 root ./5890
0644 root ./2311
0644 root ./2128
0644 root ./2346
0644 root ./5880
0644 root ./2333
0644 root ./2300
0700 root ./5553
0644 root ./5881
0644 root ./5882
0644 root ./2313
0644 root ./2304
0644 root ./2360
0644 root ./2339
0644 root ./2335
0644 root ./5883
0644 root ./2369
0644 root ./2308
0700 root ./98765
0700 root ./2129
0644 root ./2325
0700 root ./96962
0700 root ./5252
0644 root ./7333
0644 root ./5371
0644 root ./4950
0644 root ./2329
0644 root ./6606
0700 root ./3333
0644 root ./2344
0644 root ./2306
0644 root ./5859
0644 root ./5898
0644 root ./5830
0644 root ./5897
0644 root ./5860
0644 root ./2321
0644 root ./2347
0644 root ./2316
0644 root ./5862
0644 root ./5864
0644 root ./2310
0644 root ./2307
0644 root ./34699
0700 root ./7331
0644 root ./2345
0644 root ./5896
0644 root ./5870
0700 root ./2399
0644 root ./2371
0644 root ./7320
0700 root ./3338
0644 root ./2356
0644 root ./2368
0644 root ./5866
0644 root ./2323
0644 root ./2380
XXX:[XXX]/voip/old #

in none of the founded folders are both files together: unavail.wav & unavail.WAV.
just one of them exist in them:


Code:
XXX:[XXX]/voip/old # ll 7325
insgesamt 12
drwxr-xr-x 2 root root 4096  5. Aug 2011  INBOX
-rw-r--r-- 1 root root 6040  5. Aug 2011  unavail.WAV
XXX:[XXX]/voip/old # ll 5863
insgesamt 12
drwxr-xr-x 2 root root 4096  5. Aug 2011  INBOX
-rw-r--r-- 1 root root 6040  5. Aug 2011  unavail.WAV
XXX:[XXX]/voip/old # ll 3339
insgesamt 20
drwx------ 2 root root  4096  5. Aug 2011  INBOX
-rwx------ 1 root root 12670  5. Aug 2011  unavail.WAV
XXX:[XXX]/voip/old # ll 96964
insgesamt 8
drwxr-xr-x 2 root root 4096  5. Aug 2011  INBOX
-rwx------ 1 root root 3310  5. Aug 2011  unavail.WAV
XXX:[XXX]/voip/old #


so
Code:
find . -name 'unavail.wav' -o -name 'unavail.WAV' | tr A-Z a-z | sort | uniq -cd

worked fine

thx alot : )
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script for Finding files in a folder and copying to another folder

Hi all, I have a folder '/samplefolder' in which i have some files like data0.txt, data1.txt and data2.txt. I have to search the folder for existence of the file data0.txt first and if found have to copy it to some other file; next i have to search the folder for existence of file... (5 Replies)
Discussion started by: satish2712
5 Replies

2. Shell Programming and Scripting

bash - batch processing folder of files by name

Hello Everyone!!! I need some help with a shellscript to batch process a folder of files with the imagemagick convert -append/+append command. The folder contains some hundred or thousand of small images in .png format which I would like to join together in order of their filenames. The... (3 Replies)
Discussion started by: imtombi
3 Replies

3. Shell Programming and Scripting

Bash folder manipulation - selecting/copying specified files

Bash/scripting newbie here - I feel this might be a trivial problem, but I'm not sure how to tackle it. I've got a folder of a year's worth of files, with some random number of files generated every day of the year (but at least one per day). I'm writing a script to automatically grab the file with... (6 Replies)
Discussion started by: WildGooseChased
6 Replies

4. UNIX for Dummies Questions & Answers

Bash script to rename all files within a folder...

Hi. I don't have any experience with making scripts in bash. I need a simple script to rename all files in a folder to the format file1.avi, file2.avi, file3.avi, and so on..... Please note that the original files have different filenames and different extensions. But they all need to be... (2 Replies)
Discussion started by: dranzer
2 Replies

5. Shell Programming and Scripting

URGENT!!! bash script to sort files into folder according to a string in the filename

Hi all. I am very new to linux scripting and i have a task i can only solve with a script. I need to sort files base on the date string in their filenames and create a folder using the same date string then move the files to their respective folders. Scenario: Folder Path:... (1 Reply)
Discussion started by: ace47
1 Replies

6. Shell Programming and Scripting

Bash script to sort files into folder according to a string in the filename

Hi all. I am very new to linux scripting and i have a task i can only solve with a script. I need to sort files base on the date string in their filenames and create a folder using the same date string then move the files to their respective folders. Scenario: Folder Path:... (1 Reply)
Discussion started by: ace47
1 Replies

7. UNIX for Dummies Questions & Answers

Do I need to extract the entire tar file to confirm the tar folder is fine?

I would like to confirm my file.tar is been tar-ed correctly before I remove them. But I have very limited disc space to untar it. Can I just do the listing instead of actual extract it? Can I say confirm folder integrity if the listing is sucessful without problem? tar tvf file1.tar ... (1 Reply)
Discussion started by: vivien_chu
1 Replies

8. Shell Programming and Scripting

Simply bash script

I have a bash script that has 13 variables and runs commands on them. I've copied the commands 13 times but I'd like to simplify it to simply add 1 to the previous and run 13 times. The variables are dir01=/path/to/dir01 dir01=/path/to/dir02 ... up to 13. (more may be added later) ...... (6 Replies)
Discussion started by: scribling
6 Replies

9. Shell Programming and Scripting

Bash script read specific value from files of an entire folder

Hello, I heva a problem creating a script that read specifc value from all the files of an entire folder I have a number of email files into a directory and i need to extrect from each file 2 specific values. After that i have to put them into a new file that looks like that: To: value1 ... (1 Reply)
Discussion started by: ahmenty
1 Replies

10. Shell Programming and Scripting

Request for Shell script to move files from Subfolder to Parent folder and delete sub folder

Hi Team, I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder. Eg: parent folder --> /Interface/data/test/IN Sub folder -->/Interface/data/test/IN/Invoice20180607233338 Subfolder will be always with timestamp... (6 Replies)
Discussion started by: srivarun15
6 Replies
pkgproto(1)							   User Commands						       pkgproto(1)

NAME
pkgproto - generate prototype file entries for input to pkgmk command SYNOPSIS
pkgproto [-i] [-c class] [path1] pkgproto [-i] [-c class] [path1=path2...] DESCRIPTION
pkgproto scans the indicated paths and generates prototype(4) file entries that may be used as input to the pkgmk(1) command. If no paths are specified on the command line, standard input is assumed to be a list of paths. If the pathname listed on the command line is a directory, the contents of the directory is searched. However, if input is read from stdin, a directory specified as a pathname will not be searched. OPTIONS
-i Ignores symbolic links and records the paths as ftype=f (a file) versus ftype=s (symbolic link). -c class Maps the class of all paths to class. OPERANDS
path1 Pathname where objects are located. path2 Pathname which should be substituted on output for path1. EXAMPLES
Example 1: Examples of the use of pkgproto.1. The following two examples show uses of pkgproto and a partial listing of the output produced. Example 1: example% pkgproto /bin=bin /usr/bin=usrbin /etc=etc f none bin/sed=/bin/sed 0775 bin bin f none bin/sh=/bin/sh 0755 bin daemon f none bin/sort=/bin/sort 0755 bin bin f none usrbin/sdb=/usr/bin/sdb 0775 bin bin f none usrbin/shl=/usr/bin/shl 4755 bin bin d none etc/master.d 0755 root daemon f none etc/master.d/kernel=/etc/master.d/kernel 0644 root daemon f none etc/rc=/etc/rc 0744 root daemon Example 2: example% find / -type d -print | pkgproto d none / 755 root root d none /bin 755 bin bin d none /usr 755 root root d none /usr/bin 775 bin bin d none /etc 755 root root d none /tmp 777 root root EXIT STATUS
0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
pkgmk(1), pkgparam(1), pkgtrans(1), prototype(4), attributes(5) Application Packaging Developer's Guide NOTES
By default, pkgproto creates symbolic link entries for any symbolic link encountered (ftype=s). When you use the -i option, pkgproto cre- ates a file entry for symbolic links (ftype=f). The prototype(4) file would have to be edited to assign such file types as v (volatile), e (editable), or x (exclusive directory). pkgproto detects linked files. If multiple files are linked together, the first path encountered is considered the source of the link. By default, pkgproto prints prototype entries on the standard output. However, the output should be saved in a file (named Prototype or prototype, for convenience) to be used as input to the pkgmk(1) command. SunOS 5.10 6 Nov 2000 pkgproto(1)
All times are GMT -4. The time now is 01:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy