Select Script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Select Script
# 1  
Old 04-12-2009
Select Script

Dear Members:-
i want to make this script
1- i have a log directory /export/home/roxy/log
2- file name in this directory with this format
filename_DD_MM_YYYY_%H%M%S.log

i want to make script
for example:
# script.sh _09_04_2009_ _10_04_2009_
this script make select to log file into _09_04_2009_ and _10_04_2009_
and sort it by time stamp



thanks in advance
# 2  
Old 04-12-2009
hi,
just a question, why writing a script when you can us "ls -lrt" ?
Maybe i didn't understand what you need, can you explain it better?

Bye
# 3  
Old 04-12-2009
thanks sauron for your reply
but it doesn't make difference for me script or command line
but i didn't know how to make this with ls -ltr
but didn't forget
i want to select _09_04_2009_ and _10_04_2009_ and sorted by time stamp
whatever the way i agree


thanks in advance

Last edited by dellroxy; 04-12-2009 at 08:46 AM..
# 4  
Old 04-12-2009
i think this shuld work

ls -lrt | egrep "( _09_04_2009_|_10_04_2009_)"

If i understood Smilie

Bye
# 5  
Old 04-19-2009
sauron
really thanks for your effort helping me
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

How to execute a simple select script using a shell script?

Hi team, I have two select statements and need to run them using SYSDBA user select * from temp_temp_seg_usage; select segment_name, tablespace_name, bytes/ (1024*1024) UsedMb from dba_segments where segment_name='TEMP_TEMP_SEG_USAGE'; Need to run this using a shell script say named... (1 Reply)
Discussion started by: pamsy78
1 Replies

2. Shell Programming and Scripting

Help in executing select query from perl script

Hi, I have a perl snippet that call a select query with a bind variable,when i compile the script I'm unable to get the query output. The same query when i fire in sqlplus fetches few rows. The query takes bit time to fetch results in sqlplus. my $getaccts = $lda->prepare("select distinct ... (1 Reply)
Discussion started by: rkrish
1 Replies

3. Shell Programming and Scripting

File Select Menu Script

Hi All, I need to develop a bash script list “list of files” and able to select if any and set as globe variable in script and use for other function. I would like to see in menu format. Example out put Below are the listed files for database clone 1. Sys.txt 2. abc.txt 3. Ddd.txt... (1 Reply)
Discussion started by: ashanabey
1 Replies

4. Shell Programming and Scripting

Select combination unique using shell script

Hi All, bash-3.00$ gzgrep -i '\ ExecuteThread:' /******/******/******/******/stdout.log.txt.gz <Jan 7, 2012 5:54:55 PM UTC> <Error> <WebLogicServer> <BEA-000337> < ExecuteThread: '414' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "696" seconds working on the request... (4 Replies)
Discussion started by: osmanux
4 Replies

5. Shell Programming and Scripting

How to use select into command in shell script?

I need to get total number of rows in a table by using select count(*) from table and need to assign into a variable in shell script. I used the following script, it does return the number of rows but also with oracle headers, Please help me to eliminate this headers. Shell Script #!/bin/sh... (16 Replies)
Discussion started by: vel4ever
16 Replies

6. UNIX Desktop Questions & Answers

Script to select a file from a list

i m trying to write a script that will print all the txt files at /home/ directory and will allow a selection of a file and then print the file name. this is what i wrote so far: echo "please select the file from the list " list=$(ls -f *.txt /home/) array=( ) for machine in $list doat... (1 Reply)
Discussion started by: boaz733
1 Replies

7. Shell Programming and Scripting

To select a script name till .ksh or .sh

Hi All, My requirement is to search for a Table Name being used in list of script placed at a dir path : we are using below command to get the desired result : grep -H -i <Table_name> <dir_path>/* -r|awk '{print $1}'| uniq -d #It gives me below result ... (3 Replies)
Discussion started by: sanjaydubey2006
3 Replies

8. UNIX for Dummies Questions & Answers

script to ask the user to select a number

hi all, I have 4 scripts which i would need to run 1. BP.sh 2.DB.sh 3.LK.sh 4.TB.sh I would like write a script which would ask the user to select a number from 1-4 accordingly and run only that script for him/her I succeeded till reading the user input but not sure how to run that... (5 Replies)
Discussion started by: family_guy
5 Replies

9. Shell Programming and Scripting

script not working...select utility

#!/usr/bin/bash name="$@" myname=malay #echo $myname select firstname in $name; do if ;then echo $firstname else break fi done invoking with:- ./script.sh one two three four five six seven eight nine malay (6 Replies)
Discussion started by: mobydick
6 Replies

10. Shell Programming and Scripting

Extracting select queries from script

Hi, I have a script in which a lot of sql queries are embedded ie,"Select .....;".My purpose is to document all the dml statements in the script along with the line number. I am thinking of writing a perlscript or by using awk/sed scripts for extracting all the 'select' statements/queries... (3 Replies)
Discussion started by: DILEEP410
3 Replies
Login or Register to Ask a Question