Sponsored Content
Top Forums Shell Programming and Scripting Wildcard in Cshell find command Post 302287052 by phudgens on Thursday 12th of February 2009 03:30:00 PM
Old 02-12-2009
In my relentless pursuit of programming perfection, and in answer to my question above, I have discovered that the following code does what I am trying to do in the Cshell:

set pds_files = `find . -name "*.[Pp][Dd][Ss]" -print`
if ("$pds_files" != "") then
...
else
...
endif

This works regardless of the presence or absence of any .pds (or .PDS) files. It does seem, however, that I had tried this code previously in my many various permutations of it. One thing I did differently this time, however, was add empty lines separating parts of my code. Is there any conceivable way that adding empty lines can have such an effect?

While I can appreciate that the Cshell is not the best environment for programming, the thought of converting everything over to the Bourne shell makes me go queasy. I appreciate the input re: various sources of help with cshell programming.

Thanks,

Paul H.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find wildcard .shtml files in wildcard directories and removing them- How's it done?

I'm trying to figure out how to build a small shell script that will find old .shtml files in every /tgp/ directory on the server and delete them if they are older than 10 days... The structure of the paths are like this: /home/domains/www.domain2.com/tgp/ /home/domains/www.domain3.com/tgp/... (1 Reply)
Discussion started by: Neko
1 Replies

2. Solaris

Problem in using wildcard characters in xargs with find

Hi, Under my parent diectory I have directory named "Response" in many of its subfolders. I am interested to see all files with extention .pro in Response Directory. I am giving following command - find . -name "Response" -type d | xargs -i ls -lrt {}/*.pro but it is not giving result. ... (3 Replies)
Discussion started by: sanjay1979
3 Replies

3. Shell Programming and Scripting

Find replace a particular string of data with wildcard

Hi I am having a csv file in which lots of data are available wherein i need to find a particular kind of data and replace it with null value. here is the sample data.. I need to find the string starting with 404-064- and up to the first space i have to remove the data and keep the... (4 Replies)
Discussion started by: aemunathan
4 Replies

4. UNIX for Dummies Questions & Answers

Tail command with wildcard file name

Please help with the following command tail -f /appdata/logs/alert_audit517.txt | grep "Sep 02" The problem I have is with the file name "alert_audit517.txt". The 3 digit number at the end of the file name changes, so I need the file name to use a wildcard. Ive tried alert_audit***.txt, but... (5 Replies)
Discussion started by: robertson1995
5 Replies

5. Shell Programming and Scripting

Passing wildcard parameters to find via a variable

I have a script to fix permissions which is made up of blocks like: FS_ROOT=/home/shared/Photos FS_EXCLUDE=( \( -path */.webviews -o -path */.thumbnails \) -prune -o ) find $FS_ROOT ${FS_EXCLUDE} -type d -not -perm 2770 -exec chmod 2770 "{}" \; That fragment works as expected, but no matter... (3 Replies)
Discussion started by: mij
3 Replies

6. Shell Programming and Scripting

find command with wildcard directory

I want to look if there is any file inside a specific directory which was modified before 2 days. I wrote the find command, but the problem is there is one directory and that is a random directory generated by unix, so not sure on how to code for that on the find command. find... (5 Replies)
Discussion started by: srini0603
5 Replies

7. Shell Programming and Scripting

Wildcard use with SED command

Hello, I am fairly new to Linux in general and I am trying to use SED to make some replacements in a file. Below is sample of what the file is like. <Grouping id="024"><Source>ABC</Source><GroupingKey>000000000816</GroupingKey></Grouping><Grouping... (9 Replies)
Discussion started by: runforfun7
9 Replies

8. UNIX for Dummies Questions & Answers

passing command output from one command to the next command in cshell

HI Guys, I hope you are well. I am trying to write a script that gets executed every time i open a shell (cshell). I have two questions about that 1) I need to enter these commands $ echo $DISPLAY $ setenv $DISPLAY output_of_echo_$display_command How can i write a... (2 Replies)
Discussion started by: kaaliakahn
2 Replies

9. UNIX for Advanced & Expert Users

"GET" command retrieves multiple files while using wildcard

Hi All I am using GNU/Linux This is regarding the get command to retrieve files (filename with wild card characters) from remote server. I thought Get command can retrieve only 1 file irrespective of the files it has on the remote server And it is the function of mget to retrieve all... (7 Replies)
Discussion started by: sparks
7 Replies

10. UNIX for Beginners Questions & Answers

Find and replace with wildcard

HI there, I am trying to find and replace with wildcard with data chr1 69511 69511 A G 1/1:0,34:791,78,0:78:34 0/1:55,60:1130,0,1513:99:116 1/1:0,28:630,63,0:63:28 0/1:0,34:626,57,0:57:34 To this chr1 69511 69511 A G homo hetero homo hetero Where I find and replace 0/1 with... (3 Replies)
Discussion started by: daashti
3 Replies
cmddump(1)						      General Commands Manual							cmddump(1)

Name
       cmddump - simulated TRS-80 CMD file loader

Syntax
       cmddump [flags] infile [outfile startbyte nbytes]

Description
       cmddump	displays  information about TRS-80 DOS binary (command) files.	It takes an optional set of flags (described below), an input /cmd
       file, and an optional outfile, an optional starting offset of startbyte into the /cmd file, and an optional nbytes number of bytes to dump.
       Non-flag  arguments  must  be given in the order shown.	If the optional arguments are given, the given byte range is dumped from the simu-
       lated memory after loading.

Options
       -d     print detailed map; same as -m, but don't coalesce

       -i n   select ISAM entry n (0x notation OK)

       -m     print running load map as file is parsed, coalescing adjacent blocks (implies -t) (default)

       -p foo select PDS entry foo (padded to 8 bytes with spaces)

       -q     quiet; turns off -t, -m, -d, -s (later flags can override)

       -s     print summary load map after file is parsed

       -t     print text of module headers, pds headers, patch names, and copyright notices

       -x     ignore anything after the first transfer address

Author
       cmddump was written by Timothy Mann.  This man page was generated by Branden Robinson from comments in the source code.

See also
       xtrs(1)

       See the LDOS Quarterly, April 1, 1982 (Vol 1, No 4), for documentation of the TRS-80 DOS /cmd file format.  It is available on the  Web	at
       http://www.tim-mann.org/misosys.html.

								    2001-02-22								cmddump(1)
All times are GMT -4. The time now is 04:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy