Sponsored Content
Top Forums Shell Programming and Scripting script to find latest executable in particular directory and start that particular ex Post 302137273 by radoulov on Monday 24th of September 2007 05:48:28 AM
Old 09-24-2007
With the Z-Shell:

Code:
set -- *(*Nom[1]);[[ "$1" != "$prev" ]]&&./"$1";prev="$1"

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell script to find latest date and time of the files

Hi everyone, Please help:) I have a list of 1000 different files which comes daily to the directory.Some of the files are not coming to the directory now. I need to write a shell script to find the latest date and time of the files they came to the directory. The files should be unique.... (1 Reply)
Discussion started by: karthicss
1 Replies

2. UNIX for Dummies Questions & Answers

Script to find a string in a directory/sub-directory

I'm trying to find this string 'preparing string IBE_Quote_W1_Pvt.SaveWrapper for quote_header_id’ in my Apache log file directory. The log file that contains this string may be in a parent direcotry or a sub-directory. I have tried 'grep' and 'awk' with no success. I would like to get the path... (3 Replies)
Discussion started by: gross
3 Replies

3. Shell Programming and Scripting

script to find filenames with latest version and for all seq. numbers in a day

Hi, We have a requirement to find the set of filenames from the group of files in a specified folder based on (i) version number (ii) sequence number such that, for any given sequence number in a day only the latest version filenames have to indentified. Below is the format of... (4 Replies)
Discussion started by: Deepakbabu
4 Replies

4. Shell Programming and Scripting

Move the latest or older File from one directory to another Directory

I Need help for one requirement, I want to move the latest/Older file in the folder to another file. File have the datetimestamp in postfix. Example: Source Directory : \a destination Directory : \a\b File1 : xy_MMDDYYYYHHMM.txt (xy_032120101456.txt) File2: xy_MMDDYYYYHHMM.txt... (1 Reply)
Discussion started by: pp_ayyanar
1 Replies

5. Shell Programming and Scripting

find the latest files in multiple directory

I want to get the latest files from multiple directories, d1, d2,d3 and d4 under the parent dierectoy d. can anyone help out with this? thx (3 Replies)
Discussion started by: shyork2001
3 Replies

6. Shell Programming and Scripting

Find the latest directory and loop through the files and pick the error messages

Hi, I am new to unix and shell scripting,can anybody help me in sctipting a requirement. my requirement is to get the latest directory the name of the directory will be like CSB.monthdate_time stamp like CSB.Sep29_11:16 and CSB.Oct01_16:21. i need to pick the latest directory. in the... (15 Replies)
Discussion started by: sudhir_83k
15 Replies

7. Shell Programming and Scripting

Script to move latest zip file to another directory

Hi folks, In my application there is a job running which create a .dat file along with it zip file also at unix box location /opt/app/cvf/temp1 so in temp1 directory I have one .dat file and its zip file also. Now since this job runs every day so if a job runs today there will be two files... (5 Replies)
Discussion started by: punpun66
5 Replies

8. UNIX for Dummies Questions & Answers

To find the latest modified file in a directory

I am trying to fetch the latest modified file from a directory using the command find . -type f -exec ls -lt \{\} \+ | head | awk '{print $9}' After the O/P, I get the below mentioned error and the command doesnt terminate at all. find: ls terminated by signal 13 find: ls terminated by... (2 Replies)
Discussion started by: Sree10
2 Replies

9. Shell Programming and Scripting

Help with korn shell script to get the latest file versions in a directory

I want to write a korn shell script to get the latest three versions for a file in the directory having lot of files with various versions (files with prefix as same but time stamp as suffix) and compress it and at the same time have to remove the remaining versions of the file (other than latest... (4 Replies)
Discussion started by: maheshbabu
4 Replies

10. UNIX for Dummies Questions & Answers

Find exit with success with non executable directory

Hi there, I'm quite surprised by the following behavior of find. $ find -ls # I have a directory and a file in it 8145 4 drwxr-xr-x 3 me me 4096 May 10 09:36 . 87 4 drwxr-xr-x 2 me me 4096 May 10 09:36 ./dir 88 0 -rw-r--r-- 1 me me 0... (2 Replies)
Discussion started by: chebarbudo
2 Replies
gitaction(1)						      General Commands Manual						      gitaction(1)

NAME
gitaction - GNU Interactive Tools - per file type action script SYNTAX
gitaction directory file .gitaction directory file DESCRIPTION
gitaction is a script that executes a different action for each file type specified. It is called by the gitfm program when pressing F2 or ^Xa (see the gnuitrc.TERM configuration files in the gnuit manual). The first parameter is the current directory name and the second one is the file name to be matched against the default patterns. The matching is done using the shell 'case' statement. If you press F2 or ^Xa on a *.html file, gitfm will invoke a browser to view it, if you press F2 or ^Xa on a *.tar.gz file, gitfm will list the tar archive contents, if you press the same keys on a *.gz file, gitfm will display its uncompressed contents on the screen, etc ... If you press F2 or ^Xa on a *.gif file or *.jpg file and you have the zgv utility installed, you will be able to see it. If you want to change the gif/jpeg viewer, all you need to do is to change its name in the gitaction script. There are many more file types and viewers that gitaction knows about. In addition, if you are running under GNOME, gnome-open is used, and on MacOS, open(1) is used. see(1) and metamail(1) are also used as fallbacks. If all else fails, the file is displayed using $GNUIT_PAGER. Feel free to change this. If you want to find out what the default action for each file type is (or if you want to modify it), just read/modify the gitaction script. The script can be easily enhanced. Just read it. The .gitaction script is a local version of the gitaction script. When started, gitaction tries to search a script called .gitaction in the current directory and, if it finds it, it starts it. If .gitaction's exit code is 0 ( .gitaction couldn't find a matching pattern), gitac- tion starts its own case statement trying to match the current file name (the second parameter) against its default patterns. The .gitaction script *must* be executable. An example of .gitaction can be found in the directory gitfm is installed into. (usually /usr/local/bin or /usr/bin) Debian users can find it in /usr/share/doc/gnuit/examples/. You should copy the example to the current direc- tory or your home directory and then modify it. BUGS
Please send bug reports to: gnuit-dev@gnu.org SEE ALSO
gitfm(1) gitps(1) gitview(1) gitmount(1) gitkeys(1) gitrgrep(1) gitunpack(1) AUTHORS
Tudor Hulubei <tudor@cs.unh.edu> Andrei Pitis <pink@pub.ro> Ian Beckwith <ianb@erislabs.net> (current maintainer). gitaction(1)
All times are GMT -4. The time now is 05:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy