View the Most Wanted LQ Wiki articles.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 10-09-2005, 02:08 PM   #1
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, 04:06 PM   #2
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,571

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
just forget csh
Old 10-11-2005, 07:20 AM   #3
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, 09:07 AM   #4
Senior Member
Registered: Mar 2004
Location: england
Distribution: Debian, Mint, Puppy, Raspbian
Posts: 3,371

Rep: Reputation: 192Reputation: 192
read this:

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, 04:00 AM   #5
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.7, Centos 5.10
Posts: 16,917

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
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, 10:51 AM   #6
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).


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 07:45 AM
csh script variables setting zz_s Programming 2 12-04-2004 07:55 AM
shell confusion..what is diff between bash, ksh, csh, tcsh..?? servnov Linux - Newbie 7 11-18-2004 09:28 PM
BASH vs CSH: * cant see very large files pat57 Linux - Software 6 08-04-2003 03:32 PM
newgrp command within perl/csh script bobsey Programming 1 04-13-2001 11:05 PM

All times are GMT -5. The time now is 10:16 PM.

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