Visit Our UNIX and Linux User Community

Compile Multiple Files

Thread Tools Search this Thread
Operating Systems AIX Compile Multiple Files
# 1  
Old 08-23-2005
Compile Multiple Files

Hi All,

I need a script to compile multiple *.pli source files.

I can take care of the compile part, it's getting the list of files into an array or parsable string that I'm having the difficult with.

ls or find come to mind, but I can only redirect those to a file. I need to use the file list internally.

Thank You in Advance for Your Help,

# 2  
Old 08-24-2005

for i in `find . -name *.pli`
compile compile_flags $i
# 3  
Old 08-24-2005
find /dir/to/start/with -name "*pli" -exec cmd_to_compile {} \;

"{}" will be expanded to every filename found this way, so if there are 3 files, a.pli, b.pli and c.pli "cmd_to_compile" will be called 3 times:

cmd_to_compile a.pli
cmd_to_compile b.pli
cmd_to_compile c.pli

This is not recommended, though. I'd suggest you take a look at the output of "man make" and proceed from there.


Previous Thread | Next Thread
Test Your Knowledge in Computers #292
Difficulty: Easy
In 2011, Google introduced the Chromebook, a web thin client running Android..
True or False?

9 More Discussions You Might Find Interesting

1. Programming

Using basic UNIX commands to make/compile JAVA files

Hello! This is my first post, and I just learned what UNIX was this week. For a JAVA programming class I am taking, I must be able to create a directory in UNIX, use the nano command to create a JAVA program, compile it, and then run it on the command prompt using the java command. For some... (5 Replies)
Discussion started by: UNdvoItX
5 Replies

2. UNIX for Dummies Questions & Answers

Run one script on multiple files and print out multiple files.

How can I run the following command on multiple files and print out the corresponding multiple files. perl genome.gff 1.txt > 1.gff However, there are multiples files of 1.txt, from 1----100.txt Thank you so much. No duplicate posting! Continue here. (0 Replies)
Discussion started by: grace_shen
0 Replies

3. Shell Programming and Scripting

awk, multiple files input and multiple files output

Hi! I'm new in awk and I need some help. I have a folder with a lot of files and I need that awk do something in each file and print a new file with the output. The input file name should be modified when I print the outpu files. Thanks in advance for help! :-) ciao (5 Replies)
Discussion started by: gabrysfe
5 Replies

4. Programming

GCC compile help - "multiple definition" when using -g

gcc -g -o MY_ELF test1.c test2.c -lm I get this error multiple times... /tmp/cc5TzMPo.o:(.data+0x0): multiple definition of 'XYZ' (1 Reply)
Discussion started by: dragonpoint
1 Replies

5. Shell Programming and Scripting

bash script to compile multiple .c files with some options

I'm trying to write a bash script and call it "compile" such that running it allows me to compile multiple files with the options "-help," "-backup," and "-clean". I've got the code for the options written, i just can't figure out how to read the input string and then translate that into option... (5 Replies)
Discussion started by: travis.batzer
5 Replies

6. UNIX for Dummies Questions & Answers

Compiling gcc to compile make to compile yaboot

I have just installed OpenBSD on a 333MHz PPC iMac G3. It has a 6GB HDD that has been partitioned as 1GB MacOS 8.5.1, 3GB MacOS X 10.3.9, 2GB OpenBSD 4.8. I now need to install a bootloader so that my computer can recognize the OpenBSD partition at startup. I have been trying to install... (0 Replies)
Discussion started by: t04st3r
0 Replies

7. UNIX for Dummies Questions & Answers

Using AWK: Extract data from multiple files and output to multiple new files

Hi, I'd like to process multiple files. For example: file1.txt file2.txt file3.txt Each file contains several lines of data. I want to extract a piece of data and output it to a new file. file1.txt ----> newfile1.txt file2.txt ----> newfile2.txt file3.txt ----> newfile3.txt Here is... (3 Replies)
Discussion started by: Liverpaul09
3 Replies

8. HP-UX

Make command performs badly and refuses to compile on 200000 files

I am trying to run make command on 200000 files in HP UX but it refuses to compile giving a message that " command line is too long .stop" I checked and found out that there is a limit imposed by the operating system on the command line .for Eg refer following link : The maximum length of... (6 Replies)
Discussion started by: madhur.tripathi
6 Replies

9. Shell Programming and Scripting

Help - Bug: A script to compile two types of data files into two temporary files

Dear other forum members, I'm writing a script for my homework, but I'm scratching all over my head and still can't figure out what I did wrong. Please help me. I just started to learn about bash scripting, and I appreciate if anyone of you can point out my errors. I thank you in advance. ... (3 Replies)
Discussion started by: ilove2smoke
3 Replies

Featured Tech Videos