LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-09-2005, 01:08 PM   #1
unihiekka
Member
 
Registered: Aug 2005
Distribution: SuSE Linux / Scientific Linux / [K|X]ubuntu
Posts: 273

Rep: Reputation: 32
Script for csh or bash


Hi there!

I know a bit about programming in bash, but I think I should program now in csh, with which I am not so familiar (yet). I want to have a programme that searches a directory ~/X/ (and its subdirectories), which I have entered in the command line (after being asked by the programme) for files with the extension .ins. When it has found one it should run:

latex *.ins (where * stands for the file name)

Then the same for files with extension .dtx

After that the programme should copy all files with extensions .pdf or .ps to a directory ~/Y/

How can I do that?
 
Old 10-09-2005, 03:06 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,507

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
just forget csh
 
Old 10-11-2005, 06:20 AM   #3
unihiekka
Member
 
Registered: Aug 2005
Distribution: SuSE Linux / Scientific Linux / [K|X]ubuntu
Posts: 273

Original Poster
Rep: Reputation: 32
Great help... why?
 
Old 10-11-2005, 08:07 AM   #4
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,290

Rep: Reputation: 174Reputation: 174
read this:

http://www.unix.org.ua/orelly/unix/upt/ch47_02.htm

I've been working Unix for 10 years, never bothered with C shell.
Never come across a csh script.

The world uses 'sh' and 'ksh'

seriously, don't waste your time
 
Old 10-12-2005, 03:00 AM   #5
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,289

Rep: Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034
csh is old fashioned (ie doesn't have so many built-ins), so messy to work with.
Like langs, there's always someone who insists on using it, but most people use bash if linux/bsd, ksh if commercial Unix, or posix sh.
Personally, I wouldn't bother until/if you have to maintain someone else's csh code (& I'd prob re-write anyway )
 
Old 10-15-2005, 09:51 AM   #6
eddiebaby1023
Member
 
Registered: May 2005
Posts: 378

Rep: Reputation: 33
I agree with the other posters on here - csh is a dead end scripting language (it's pretty poor as an interactive shell, too IMO). I'm amazed that someone who could produce such a marvellous editor as vi could produce such an appalling shell. And it's buggy as hell since it's so old and undeveloped. It's the lack of Bounre shell compatibility that really makes it a poor choice (like zsh, which is Bourne incompatible in a few subtle but important areas).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to add script files to /etc/csh.login Enigmatic_Desires Linux - Newbie 2 06-22-2005 06:45 AM
csh script variables setting zz_s Programming 2 12-04-2004 06:55 AM
shell confusion..what is diff between bash, ksh, csh, tcsh..?? servnov Linux - Newbie 7 11-18-2004 08:28 PM
BASH vs CSH: * cant see very large files pat57 Linux - Software 6 08-04-2003 02:32 PM
newgrp command within perl/csh script bobsey Programming 1 04-13-2001 10:05 PM


All times are GMT -5. The time now is 08:55 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration