include all files under a directory


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting include all files under a directory
# 1  
Old 12-14-2006
include all files under a directory

I want to include all the subnet files under /etc/dhcpd/ to /etc/dhcpd.conf

so here is my content of dhcpd.conf

...
include "/etc/dhcpd/*";


however, the check-syntax reports syntax error, as they do not recognize the wildcard *, and display that " file /etc/dhcpd/* could not be found.

how can I use wildcard to refer to all the files in this directory?
# 2  
Old 12-15-2006
MySQL

is there any idea?
# 3  
Old 12-15-2006
Code:
for dr in *
do
    echo "include $PWD/$dr;"
done

Copy the output of the above code and paste in to your file
# 4  
Old 12-15-2006
Quote:
Originally Posted by anbu23
Code:
for dr in *
do
    echo "include $PWD/$dr;"
done

Copy the output of the above code and paste in to your file

This is not the way I expect;
In addition, your code produce the following:

include /home/htao/trial/new/*;
# 5  
Old 12-16-2006
Quote:
Originally Posted by fredao
This is not the way I expect;
In addition, your code produce the following:

include /home/htao/trial/new/*;
Code:
cd /etc/dhcpd/
for dr in *
do
    echo "include $PWD/$dr;"
done

First move the directory where you have the files to include
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find Command Include Sub Directory

This script writes the output files to FILES but I don't want to exclude all directories from ABC_CHQ and LYS_ADV, I want to include one sub directory name process which is under ABC_CHQ and LYS_ADV in the search. Right now its excluding everything from prune directories such as ABC_CHQ, LYS_ADV... (10 Replies)
Discussion started by: John William
10 Replies

2. Shell Programming and Scripting

Include libexec directory for script when run

Hi everyone! This is my first post, so bear with me. I have this script, vpm, which make use of the libexec directory for commands intended to be run by the bin/vpm binary. I want to add the libexec directory to $PATH when running the vpm binary. I don't want the script itself to try figure... (2 Replies)
Discussion started by: KevinSjoberg
2 Replies

3. Programming

Include files

I have an implementation file tomog.cpp that implements a class called Tomog where I need to include its header file which resides in another place. How can I best specify the include file? I would not like to do #include "../../tomso/tomography/tomog.hpp" I wish to do instead ... (3 Replies)
Discussion started by: kristinu
3 Replies

4. Shell Programming and Scripting

making find/sed to include directory names with spaces

how can i make find/sed to include directory names with spaces the command is like this for i in `find wp-content/themes -type f -print0 | xargs -0 grep -l -iE 'e'`;do sed -i -e 's/word1/word2/gI' "$i";done but it skips one directory names with spaces sed: can't read ./Nova: No such... (5 Replies)
Discussion started by: vanessafan99
5 Replies

5. HP-UX

How do I include header files outside of my current directory

I am trying to compile a file called PPFormatageMUT.c in which I have included header file which are at some other location but the point is that while compiling the file, it is throwing error saying that error : no such file or directory source code location:... (1 Reply)
Discussion started by: ezee
1 Replies

6. UNIX for Dummies Questions & Answers

linux include files

what is the relationship between /usr/include/sys/*.h and /usr/include/unistd.h ? Fuctions in unistd.h are syscalls. Do the fuctions in sys/*.h call syscalls? (7 Replies)
Discussion started by: vistastar
7 Replies

7. Solaris

include files

Our admin has upgraded our OS solaris system to 5.11 but no more I can compile any trivial or non-trivial code. I'm trying to compile a trivial c++ program(a Helloworld program) but It gives error indicating that include files do not exist (in this trivial case <stdio.h>), it starts compiling but... (1 Reply)
Discussion started by: Newsha
1 Replies

8. Programming

gcc does not include certain .h-files

Hi there! gcc seems not to include available files, see below: What should I do? Look forward to your reply/replies! Thanks Grahamb In the source directory I enter: #gcc -Wall -I/usr/include ./gtkdaq.c > ./out.log 2>&1 Response: In file included from ./gtkdaq.c:3:... (2 Replies)
Discussion started by: grahamb
2 Replies

9. UNIX for Dummies Questions & Answers

why does tar sometimes include directory information?

hi, say I have dirA/file1 dirB/file2 and I tar them up, and then do zcat Tar.tar | tar tvf - Sometimes I will see: dirA/ dirA/file1 dirB/ dirB/file2 yet other times I will see (4 Replies)
Discussion started by: JamesByars
4 Replies

10. Programming

Include files

Hi, I am new to the unix networking. I have written one client and server for UDP sockets.. I got the following errors while conpilation I have include all include files. Could some one help ...is there any other file to be included.....? will the include files change on different unix... (3 Replies)
Discussion started by: reddyb
3 Replies
Login or Register to Ask a Question