The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
read files from folder and then call another script girishnn UNIX and Linux Applications 1 11-08-2007 09:52 PM
read files from folder and then call another script girishnn Shell Programming and Scripting 3 11-06-2007 06:53 PM
Help!! Need script to read files and add values by lines... dhuertas Shell Programming and Scripting 3 09-15-2007 11:14 PM
How to make a cshell (csh) script interactive jimmynath Shell Programming and Scripting 2 09-07-2005 01:28 PM
Script with read/write Files steiner Shell Programming and Scripting 5 07-25-2003 10:46 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-18-2004
homerj546 homerj546 is offline
Registered User
  
 

Join Date: Apr 2004
Posts: 3
help with cshell script to read 1 or more lex files

taskes one or more .l files and compiles them

#!/usr/bin/csh
#while loop to carry on asking user to enter the files
while $number!=0
echo "enter file name"



#check to see if file ends with .l

#if file ends with .l compile lexx.yy.c file for each file

this is how i think it needs to be done but im not sure?????

can ne1 help me
  #2 (permalink)  
Old 04-18-2004
home_king home_king is offline
Registered User
  
 

Join Date: Apr 2004
Location: China
Posts: 15
Do you mean files with suffix name .l ?

Here is bash's implementation(Csh is similar to it):
Code:
#!/bin/sh
while read -a lfiles -p "Enter files to process:"; do
	for file in "${lfiles[@]}";do
		if[ "${file##*.}" == "l" ];then
			# Place your compilation procedure here
		fi		
	done
done

Last edited by home_king; 04-18-2004 at 10:06 AM..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:10 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0