Sponsored Content
Top Forums Shell Programming and Scripting Check for file existence using wildcards Post 302365216 by phudgens on Monday 26th of October 2009 10:19:50 AM
Old 10-26-2009
Check for file existence using wildcards

Thanks for the reply. This is not the first time that someone has suggested that I not use C Shell coding for my scripts. The problem is that all of my users log in to, and launch their programs from, the C Shell. I really have no choice but to write my scripts for that shell.

For the present, I'm not going to worry about whether a directory is readable or not. I'm assuming that none of my users are sufficiently UNIX savvy to know how to create a directory that is not readable.

Thanks again for all the help and input.

Paul H.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Csh to check for existence of file

Hi, I would like to check the existence of files (doesn;t matter the number of files) in a directory. My file is named in the following manner (always ending with " myfile "). Can anybody give me some guidance? EG: abc1_myfile sdfr_myfile sffgd_myfile and so on ...... My... (9 Replies)
Discussion started by: Raynon
9 Replies

2. AIX

how to check the existence of a file during ftp using korn shell?

i can able to transfer a file from build server(AIX)to webserver using ksh through ftp.my query is to check the existence of file while transfering from one server to other .i.e i need some command or script that checks the existence of file with same name in both server,within ftp syntax. ... (1 Reply)
Discussion started by: karthikprasathk
1 Replies

3. AIX

how to check the existence of a file using korn shell?

we have tranferred an ear from local server to remote server using ftp.consider, we have an ear file named a.ear in remote server,again if we transfer the same file named a.ear from local server to remote server.we need the kshell to check the existence of the ear file in remote server,and if the... (3 Replies)
Discussion started by: karthikprasathk
3 Replies

4. AIX

check for file existence

Hello I am having a requirement like if there is no file in the directory then i need a message to pop on after the execution of the script. My script basically does for File in `ls -t $DIRECTORY | tail -1`; if there is no file the DIRECTORY then the script is simply exiting with out... (2 Replies)
Discussion started by: dsdev_123
2 Replies

5. AIX

Check for File Existence

I have requirement where i need to search for files which start with SALESORDER and PURCHASEORDER. i need to process the files with SALESORDER first and then PURCHASEORDER. If SALESORDER files are not there i dont want to process PURCHASEORDER and i want to come out of script. I have written a code... (4 Replies)
Discussion started by: dsdev_123
4 Replies

6. Shell Programming and Scripting

How to check for file existence?

i want to check if the file is in the directory or not, and also it should be handle error conditions, like missing files and report the error and exit. i did something like this: file ="hello" if !test -e "${file}" then echo "No such files exist!" exit 1 else do something....... fi ... (1 Reply)
Discussion started by: mingming88
1 Replies

7. Shell Programming and Scripting

script to check for existence of file (or else sleep for x time)

Hi Forum. I have a script that accepts 3 input parameters (source directory, list file text, sleep time) and checks for the presence of files. If not there, script goes to sleep for certain amount of time provided by 3rd input. list file text contains 1 entry but may contain more (file... (13 Replies)
Discussion started by: pchang
13 Replies

8. Shell Programming and Scripting

command to check existence of file name which has regex

Hi All. Pls help me with the command to check existence of files (I'll mention name of the file as regex) and proceed with my further processing if atleast one of them exists in detail, I've a dir /tmp/TURP, which may or may not have files named with "exter*.txt" I need to check and... (2 Replies)
Discussion started by: skpvalvekar
2 Replies

9. UNIX for Dummies Questions & Answers

To check for existence of a file

I need to check for the existence of a file *.log in a specific directory using a perl script. Presently am not in that particular directory. So i am using chdir ("/path/to/my/file) And then i am using the -e in an if statement to check if it exists. if (-e $File) {......} $File contains the... (1 Reply)
Discussion started by: manutd
1 Replies

10. Shell Programming and Scripting

File existence check

hi i wanted to check if the file exist or not(multiple files) DIRE=/home/V478 if ; then echo "file present" else echo "file not present" fi But i am getting the error as : [: unexpected operator/operand (3 Replies)
Discussion started by: ATWC
3 Replies
LUSH(1) 						       Lisp Universal Shell							   LUSH(1)

NAME
lush - Lisp Universal Shell SYNOPSIS
lush [@initfile][lushfile...args...] DESCRIPTION
lush starts the Lisp Universal Shell. Lush is an object-oriented Lisp interpreter/compiler with features designed to please people who want to prototype large numerical applica- tions. Lush includes an extensive library of vector/matrix/tensor manipulation, a set of graphic functions, a simple GUI toolkit, and interfaces to various libraries such as OpenGL, SDL, the SGI Multimedia library (video/audio grabbing), the Numerical Recipes library, and others. Lush is an ideal frontend script language for programming projects written in C or other languages. RUNNING LUSH INTERACTIVELY
Online help on the standard library is available by typing (helptool) at the Lush prompt. You can leave Lush by typing CTRL-D at the prompt. On startup, Lush loads various libraries from the sys and lsh directories, as well as a .lushrc file in the user's home directory. It is recommended to add a directory lsh in your home directory and to include the line (addpath "your-home-directory/lsh") to your .lushrc so that your own Lush programs are found in Lush's search path. It is quite convenient to run Lush from within Emacs, which can be done by creating somewhere in your path a symbolic link named "lisp" to the lush executable. Then, type ESC-X run-lisp in Emacs. It is probably a good idea to add the following line in your .emacs so Emacs switches to Lisp mode when editing a Lush file: (setq auto-mode-alist (append (cons ".lsh$" 'lisp-mode) auto-mode-alist)) RUNNING NON-INTERACTIVE LUSH SCRIPTS In Unix, Lush can be used to write scripts that can be called from a shell prompt (like shell or Perl scripts). A list of command-line arguments are put in the argv variable. Here is an example: create a file (say "capargs") with the following content (replacing the first line by the path to your lush exe- cutable): #!/bin/sh exec lush "$0" "$@" !# (printf "capitalizing the arguments:0) (each ((arg argv)) (printf "%s %s0 arg (upcase arg))) then, make capargs executable: chmod a+x capargs. You can now invoke capargs at the shell prompt: % capargs asd gfdf capitalizing the arguments: capargs CAPARGS asd ASD gfdf GFDF FILES
/usr/share/lush The top of the Lush directory structure /usr/share/lush/src Source code of the interpreter /usr/share/lush/sys Core libraries (lush sources) without which Lush cannot run. A minimal/customized version of Lush needs only that directory to run. /usr/share/lush/etc Various shell scripts and utilities /usr/share/lush/include /usr/share/lush/lsh Library files (lush sources) that are part of the standard distribution. Although they are not required for Lush to run, life would really suck without them. /usr/share/lush/packages Library files (lush sources) for special applications or platforms, or programs that have been contributed by users and cannot be assumed to be present/working in all installations of Lush. /usr/share/lush/local Lush libraries that are specific to your site. ~/.lushrc Personal Lush initialization file ~/.lush Personal Lush directory: on-demand built libraries, etc HISTORY
Lush is the direct descendant of the SN system. SN was first developed as a neural network simulator with a Lisp-like scripting language. The project was started in 1987 by Leon Bottou and Yann LeCun, and rewritten several times since then. SN was used at AT&T for many research projects in machine learning, pattern recognition, and image processing. Its various incarnations were used at AT&T Bell Labs, AT&T Labs, the Salk Institute, the University of Toronto, Universite of Montreal, UC Berkeley, and many other research institutions. The commercial versions of SN were used in several large companies as a prototyping tool: Thomson-CSF, ONERA. SEE ALSO
Use (helptool) in an interactive lush session for browsing of online documentation. AUTHORS
Lush was written by Leon Bottou and Yann LeCun. Contributors include: Patrice Simard, Yoshua Bengio, Jean Bourrelly, Patrick Haffner, Pas- cal Vincent, Sergey Ioffe, and many others. This manual page was written by Kevin Rosenberg <kmr@debian.org> for the Debian Project (but may be used by others). 1.1 2005-12-14 LUSH(1)
All times are GMT -4. The time now is 08:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy