Sponsored Content
Top Forums Shell Programming and Scripting to find the file with full path Post 86101 by vino on Tuesday 11th of October 2005 07:21:03 AM
Old 10-11-2005
Quote:
Originally Posted by surjyap
the satement (2) lists the same files with their full path. But here I get some duplicate lines in tmp file when two files with same name in different directories. Due to some condition I have no clue to remove the duplicate entries bcoz it is unknown that which entry should be removed. The above script works fine if there is no multiple file ahving same name.
As far as I understand, you want to remove the duplicates files which have different paths.

Look at this thread.

Removing duplicate files from list with different path

vino
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

extract only file name from full path file name

What is the smartest way to just extract file name from a full path name. e.g. if I have /usr/sanjay/bin/file_name.c I want only file_name.c Sanjay (2 Replies)
Discussion started by: sanjay92
2 Replies

2. UNIX for Advanced & Expert Users

process executable file full path

hi guys i give "ps -ef | grep some_executable_file" on the command line. this "some_executable_file" resides on many paths which r included in the PATH environment variable, so the output depicts only "some_executable_file" in the COMMAND column. how can i get the full path? thanx (3 Replies)
Discussion started by: xtrix
3 Replies

3. UNIX for Advanced & Expert Users

list all files with full path of the file

How can i list every single file on a sun solaris server running 2.8 starting from '/' with the full path included in it? example. / ... ... ... /etc/inetd.conf /etc/passwd /etc/shadow ... ... ... /var/adm/messages /var/adm/messages.0 /var/adm/messages.1 ... ... ...... (4 Replies)
Discussion started by: Sowser
4 Replies

4. Shell Programming and Scripting

list file with full path

This has been bugging me for a while. How can i list file to show full path. /directory/test $ ls file.tst file.tst $ desired output: /directory/test/file.tst (2 Replies)
Discussion started by: ryandegreat25
2 Replies

5. Shell Programming and Scripting

Retrieve directory path from full file path through sh

Hi, I have a file abcd.txt which has contents in the form of full path file names i.e. $home> vi abcd.txt /a/b/c/r1.txt /q/w/e/r2.txt /z/x/c/r3.txt Now I want to retrieve only the directory path name for each row i.e /a/b/c/ /q/w/e/ How to get the same through shell script?... (7 Replies)
Discussion started by: royzlife
7 Replies

6. Shell Programming and Scripting

Return Full File Path To Array PERL

Iam trying to load the full path of multiplie files in the same directory to an array if the filenames matches a pattern. The following is the current code; where $input=C:\test # change to and open the comparison directory chdir("$input2") || die "Cannot change dir: $!"; opendir(DIR2,... (2 Replies)
Discussion started by: cold_Que
2 Replies

7. Shell Programming and Scripting

How to extract strings from full path when full path is not fixed

/Path/snowbird9/nrfCompMgrRave1230100920.log.gz:09/20/2010 06:14:51 ERROR Error Message. /Path/snowbird6/nrfCompMgrRave1220100920.log.gz:09/20/2010 06:14:51 ERROR Error Message. /Path/snowbird14/nrfCompMgrRave920100920.log.gz:09/20/2010 06:14:51 ERROR Error Message.... (0 Replies)
Discussion started by: Shirisha
0 Replies

8. Shell Programming and Scripting

Grep File Full Path in a file

Hi, I would like to know how to grep all the paths in a file having extension .BMP For e.g. File Name : sample.txt File Content : xxxxxxxxxxxxxxxxx xxxxx/root/cdrive/picure.BMP xxxx xxxxxxxxxxx xxxxx/root/ddrive/picure.BMP xxxx xxxxxxxxxxx Expected Output : ... (4 Replies)
Discussion started by: vdivb
4 Replies

9. Linux

How to print full path name along with file extension?

Hi I have a requirement like this: /abc/a/x.txt /abc/a/y.txt /abc/b/x.gz /abc/b/y.txt I need output like this: /abc/a:*.txt /abc/b:*.txt /abc/b:*.gz I have tried find /abc -type f -name "*.*" ||awk -F . '{print $NF}' it is print only extensions without path name. Please... (5 Replies)
Discussion started by: lijjumathew
5 Replies

10. Shell Programming and Scripting

Find and replace the path value in files, pattern is not full known.

Hi, I need to do find and replace, but the pattern is not full known. for example, my file has /proj/app-d1/sun or /data/site-d1/conf here app-d1 and site-d1 is not constant. It may be different in different files. common part is /proj/xx/sun and /data/xxx/conf i want to find where ever... (6 Replies)
Discussion started by: rbalaj16
6 Replies
withlist(8)						      System Manager's Manual						       withlist(8)

NAME
withlist - General framework for interacting with a mailing list object. SYNOPSIS
withlist [options] listname [args ...] There are two ways to use this script: interactively or programmatically. Using it interactively allows you to play with, examine and mod- ify a MailList object from Python's interactive interpreter. When running interactively, a MailList object called `m' will be available in the global namespace. It also loads the class MailList into the global namespace. Programmatically, you can write a function to operate on a MailList object, and this script will take care of the housekeeping (see below for examples). In that case, the general usage syntax is: OPTIONS
-l, --lock Lock the list when opening. Normally the list is opened unlocked (e.g. for read-only operations). You can always lock the file after the fact by typing `m.Lock()' Note that if you use this option, you should explicitly call m.Save() before exiting, since the interpreter's clean up procedure will not automatically save changes to the MailList object (but it will unlock the list). -i, --interactive Leaves you at an interactive prompt after all other processing is complete. This is the default unless the -r option is given. -r [module.]callable, --run [module.]callable This can be used to run a script with the opened MailList object. This works by attempting to import module (which must already be accessible on your sys.path), and then calling callable from the module. callable can be a class or function; it is called with the MailList object as the first argument. If additional args are given on the command line, they are passed as subsequent positional args to the callable. Note that module. is optional; if it is omitted then a module with the name callable will be imported. The global variable `r' will be set to the results of this call. -a, --all This option only works with the -r option. Use this if you want to execute the script on all mailing lists. When you use -a you should not include a listname argument on the command line. The variable `r' will be a list of all the results. -q, --quiet Suppress all status messages. -h, --help Print a small help text and exit EXAMPLES
Here's an example of how to use the -r option. Say you have a file in the Mailman installation directory called `listaddr.py', with the following two functions: def listaddr(mlist): print mlist.GetListEmail() def requestaddr(mlist): print mlist.GetRequestEmail() Now, from the command line you can print the list's posting address by running the following from the command line: % bin/withlist -r listaddr mylist Loading list: mylist (unlocked) Importing listaddr ... Running listaddr.listaddr() ... mylist@myhost.com And you can print the list's request address by running: % bin/withlist -r listaddr.requestaddr mylist Loading list: mylist (unlocked) Importing listaddr ... Running listaddr.requestaddr() ... mylist-request@myhost.com As another example, say you wanted to change the password for a particular user on a particular list. You could put the following function in a file called `changepw.py': from Mailman.Errors import NotAMemberError def changepw(mlist, addr, newpasswd): try: mlist.setMemberPassword(addr, newpasswd) mlist.Save() except NotAMemberError: print 'No address matched:', addr and run this from the command line: % bin/withlist -l -r changepw mylist somebody@somewhere.org foobar AUTHOR
Author of Mailman is the Mailman Cabal, see http://www.list.org/ for information. This manpage is written for Debian by Bernd S. Brentrup <bsb@debian.org>. SEE ALSO
Mailman documentation on http://www.list.org/ and in /usr/share/doc/mailman. 2004-03-24 withlist(8)
All times are GMT -4. The time now is 04:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy