Sponsored Content
Top Forums Shell Programming and Scripting ls -l /directory/path | grep -f filter.txt NOT WORKING Post 302648523 by wolf@=NK on Wednesday 30th of May 2012 04:07:23 AM
Old 05-30-2012
filter.txt are filenames

Quote:
Originally Posted by Scott
I'm going to make an assumption that filter.txt has ^M characters on each line.

What is the output of cat -v filter.txt?

(and please, don't use that for-loop method. It's pointless.)
Code:
>cat filter.txt
request-key.conf
devscripts.conf
kernel-img.conf
nsswitch.conf
ca-certificates.conf
ntp.conf
updatedb.conf
libao.conf
deluser.conf
uniconf.conf
sysctl.conf
mtools.conf
preload.conf
netscsid.conf
mtab.defs
passwd.defs
sudoers.defs
hosts.defs
qemu-ifup
pbuilderrc.defs
profile.defs
debian_version.defs
networks.defs
bindresvport.blacklist.defs
lintianrc.defs
bash_completion.defs
locale.alias.defs
dput.cf.defs
inputrc.defs
protocols.defs
a2ps.cfg.defs


Last edited by Scott; 05-30-2012 at 05:08 AM.. Reason: Use code tags, please...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

need help--script to filter specific lines from multiple txt files

Hi folks, - I have 800 txt files - those files are cisco router configs router1.txt router2.txt ... router800.txt I want to accomplish the following: - I want to have a seperate file with all the filenames that I want to process - I want a script that goes trough all those... (7 Replies)
Discussion started by: I-1
7 Replies

2. Shell Programming and Scripting

how do I filter double lines from a txt file

Hi, I have a file with the following: access-list.txt router1 access-list 1 permit any any access-list 1 deny any any router2 access-list 2 permit any any access-list 2 deny any any router3 access-list 3 permit any any access-list 3 deny any any I want to hava an output that... (10 Replies)
Discussion started by: I-1
10 Replies

3. Shell Programming and Scripting

sed to read x.txt and grep from y.txt

How would I write a command(s) to read from a file (list) that looks like this: 29847374384 and grep from a second file (list) that looks like this: 29847374384, jkdfkjdf,3833,ddd:confused: (1 Reply)
Discussion started by: smellylizzard
1 Replies

4. UNIX for Dummies Questions & Answers

Present Working Directory (not the full path)

Hi, Is there a command that tells you right away the current working directory? I know the command "pwd", but that one gives the full path. if pwd gives me: /a/b/c/d/ggg/HERE I want something that will give me: HERE Thanks, Gaurab (13 Replies)
Discussion started by: gaurab
13 Replies

5. Shell Programming and Scripting

"find . -printf" without prepended "." path? Getting path to current working directory?

If I enter (simplified): find . -printf "%p\n" then all files in the output are prepended by a "." like ./local/share/test23.log How can achieve that a.) the leading "./" is omitted and/or b.) the full path to the current directory is inserted (enclosed by brackets and a blank)... (1 Reply)
Discussion started by: pstein
1 Replies

6. Shell Programming and Scripting

Filter specified path

We have 10 jobs entry in crontab like this 0 7 * * 0 && (source /x/y/z .bashrc ; /x/y/z /test.sh Table1 /ABC/TEST >x/y/z/log (every job have different o/p Path) can any one help me to filter only the output PATH /ABC/TEST from the file dup_cron. (1 Reply)
Discussion started by: netdbaind
1 Replies

7. UNIX and Linux Applications

Ssmtp -t < /path/to/the/message.txt (How to format message.txt for html email)

ssmtp has been running well under Kubuntu 12.04.1 for plain text messages. I would like to send html messages with ssmtp -t < /path/to/the/message.txt, but I cannot seem to get the message.txt file properly formatted. I have tried various charsets, Content-Transfer-Encoding, rearranging the... (0 Replies)
Discussion started by: Ronald B
0 Replies

8. Shell Programming and Scripting

Help with shell script - filter txt file full of ips

Hello again gentlemen. I would like to make a shell script to 'optimize' a plain text full of IPs. Let's suppose to have this text file: 1.192.63.253-1.192.63.253 1.0.234.46/32 1.1.128.0/17 1.116.0.0/14 1.177.1.157-1.177.1.157 1.23.22.19 1.192.61.0-1.192.61.99 8.6.6.6 I want to... (2 Replies)
Discussion started by: accolito
2 Replies

9. UNIX for Beginners Questions & Answers

Convert Relative path to Absolute path, without changing directory to the file location.

Hello, I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
Discussion started by: Sekhar419
4 Replies

10. UNIX for Beginners Questions & Answers

What is the difference ../directory path and ./directory path in ksh?

What is the difference ../directory path and ./directory path in ksh? (1 Reply)
Discussion started by: TestKing
1 Replies
nisserver-plugin-defs(1)				   System Administrator's Manual				  nisserver-plugin-defs(1)

NAME
nisserver-plugin-defs - print default settings for the NIS server plugin SYNOPSIS
nisserver-plugin-defs [-d domain ] [-m map ] [-s suffix ] DESCRIPTION
The nisserver-plugin-defs command produces example configuration entries containing the default settings which the NIS server plugin will use for all maps for which it has built-in defaults, or if a particular map name is specified, for one map. ARGUMENTS
-d DOMAIN By default, nisserver-plugin-defs uses a placeholder for the NIS domain name when it prints example configuration entries. This option allows a particular domain name to be specified. -m MAP By default, nisserver-plugin-defs prints example configuration entries for all of the maps for which it has built-in defaults. This option can be used to examine the defaults associated with a particular map name. -s SUFFIX By default, nisserver-plugin-defs uses a placeholder for the base DN under which it expects to find entries which are relevant for the map. This option allows a particular search base to be specified. BUGS
Probably, but let's hope not. If you find any, please file them in the bug database at http://slapi-nis.fedorahosted.org/. AUTHOR
Nalin Dahyabhai <nalin@redhat.com> slapi-nis 2011/04/19 nisserver-plugin-defs(1)
All times are GMT -4. The time now is 04:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy