Shell Script..plzz help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell Script..plzz help
# 1  
Old 11-19-2010
Shell Script..plzz help

Hi all,

if any body could help me out to automate the unix script for finding some particualar files which are based on dates
like see every day i need check the TXT files which are being in processed and Sequential order based on dates

For Example:
files name starts at line***_201008250800.txt(Date format : YYYYMMDDHHMM)
so i need to find that they are up to date and in order


help me
# 2  
Old 11-19-2010
Please post sample input and expected output.
# 3  
Old 11-19-2010
the directory will i need look in to it is..../fus**/data/coll/ in this directory we will be seeing, so many folder which has daily processed files in TXT with date which i have mentioned in before
so i need it daily to get into it and check if the files of the particular folder is in the sequence order or not...
Input : file name from 12775048994_125342__***(text)_201010010800.txt to
13775048994_145342__***(text)_201011190800.txt

(Bold one should be the date format and it should be in the sequence like for ex: above date it is october 1st 2010 to nov 19th 2010 remaining all doesn't matter)

Output : it should tell this date is not present in between and from this date it is not in sequence like any thing which good to analyse
# 4  
Old 11-21-2010
plzz can anybody help me...plzzz
# 5  
Old 11-21-2010
Did you try something like :
Code:
ls /fus*/data/coll/*/*__*_$(date '+%Y%m%d')*.txt

or
Code:
find /fus*/data/coll -name "*_$(date '+%Y%m%d')*.txt"

(to be adapted of course, you shoud restrict the matching condition as much as you can)
# 6  
Old 11-21-2010
is that it finds the sequence....right now i am looking manually by seein them that they are in sequence or not...
# 7  
Old 11-21-2010
I don't understand what need to be checked (i mean, your sequence story)
If your question is how to get the bold stuff from the file name then :
Code:
F='12775048994_125342__***(text)_201010010800.txt'
a=${F##*_}
BOLDSTUFF=${a%%.*}

Code:
[ctsgnb@shell ~/sand]$ F='12775048994_125342__***(text)_201010010800.txt'
[ctsgnb@shell ~/sand]$ a=${F##*_}
[ctsgnb@shell ~/sand]$ echo "${a%%.*}"
201010010800
[ctsgnb@shell ~/sand]$

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to write Config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

2. Shell Programming and Scripting

Unable to pass shell script variable to awk command in same shell script

I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist. diff=$1$2.diff id=$2 new=new_$diff echo "My id is $1" echo "I want to sync for user account $id" ##awk command I am using is as below cat $diff | awk... (2 Replies)
Discussion started by: Ashunayak
2 Replies

3. Homework & Coursework Questions

need help with a shel script plzz

hey how u doing guys ... I'm a student @ EMU and taking a beginner Linux class and I have those two extra credit project that im struggling with so I hope to get some correction and help write a shell script that will 1-prompt the user for a file name 2-check to see if the file exists... (2 Replies)
Discussion started by: flyman
2 Replies

4. Shell Programming and Scripting

Strange errors with shell scripts..plzz help

Hi all... Please help me with this questions. I am not good at shell scripting. 1) It seems like there are many ways that we can run the shell scripts. what is the difference between each one? i)./shell_script.sh ii).(space)./ shell_script.sh iii)sh shell_script.sh ... (3 Replies)
Discussion started by: sanskumar2003
3 Replies

5. Shell Programming and Scripting

How to use ssh execute other shell script on other host (shell script include nohup)?

i want use ssh on the host01 to execute autoexec.sh on the host02 like following : host01> ssh host02 autoexec.sh autoexec.sh include nohup command like follwing : nohup /home/jack/deletedata.sh & after i execute ssh host02 autoexec.sh one the host01. i can't found deletedata.sh... (1 Reply)
Discussion started by: orablue
1 Replies

6. Shell Programming and Scripting

Not able to solve these questions plzz help

1.Display a list of /usr/share/doc subdirectories containing information about shells.How many README files do these subdirectories contain? Don't count anything in the form of "README.a_string". 2.Make a list of files in your home directory that were changed less that 10 hours ago, using grep,... (2 Replies)
Discussion started by: cynosure2009
2 Replies

7. Shell Programming and Scripting

I need to add something to a file, plzz help

The first step for you to create the script to change “JAVA_OPTS” variable definition as follows: Original line: JAVA_OPTS="-Dname=$JAVA_NAME -Xmx$JVM_MAX -DAGENT_HOME=$RT_HOME -DINSTALL_DIR=$RT_HOME -Djavax.net.ssl.keyStore=$RT_HOME/conf/client.keystore ... (3 Replies)
Discussion started by: asirohi
3 Replies

8. Shell Programming and Scripting

shell script & sqlplus "plzz help"

hi friends, i m tryin to load data from one set of table to other i have sql procedure al ready for it..! i m going to load the procedure only if data in one of my table for example table "landing " have 10 records each attribute of this table is file_name status date ... (2 Replies)
Discussion started by: kulbir
2 Replies

9. UNIX for Dummies Questions & Answers

problem with GREP, help plzz

I just want the output of this command to be stored in a variable like, str = `grep Application.dbName serverdata/ServerProp.txt` but while executing it says like, str : startup 11: not found, where startup is the script name. but while running the command alone like, grep... (2 Replies)
Discussion started by: cs_sakthi
2 Replies
Login or Register to Ask a Question