Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Please I am new to this.

Status
Not open for further replies.

vrooyejc

Programmer
Nov 28, 2002
2
ZA
I have this script its purpose is to touch all files with jsp extentions in all dir's, sub and sub -sub dir's.

This example does not work and I have gotten the idea to do it this way from an example that was posted on this forum to remove files older than a certain time.

I would be greatfull for any assistance

Thanks Johan

#!/bin/sh

LIST=`find /webuser/ -name *.jsp´

for FILE in $LIST
do
touch $FILE
done
 
Hi,
I'm really really new on Linux
and I need to do some stuff on a ksh bash

1. I need to create a file containing a list (in reverse date order (oldest first) of all the files in the directory specified by the enviroment variable

I used:
#!/bin/bash
ls -t -A -r /$testdir/ >$FLOW/ls.lst
cat $FLOW/ls.lst

2. and then how can I get the first non-null line from this file (ls.lst) and store it as firstline

i used for this:
#!/bin/bash
cat $FLOW/ls.lst | while read -r firstline
do
read -r firstline
export firstline
done
echo $firstline

Any idea?
ALA


 
vrooyejc
sorry man
when I sais I'm new I meant it
forget previous email
ALA
 

for FILE in `find /path -name \*.xxx`
do ....
done

or

for FILE in `find /path|grep 'xxx$'`
... -----------
when they don't ask you anymore, where they are come from, and they don't tell you anymore, where they go ... you'r getting older !
 
Code:
find /webuser/ -name *.jsp -exec touch {} \;

should do it wuickly for you :)
 
on solaris: MASK the *
before using -exec (can be very dangerous, especially for newcomer)
check the output of find.
-----------
when they don't ask you anymore, where they are come from, and they don't tell you anymore, where they go ... you'r getting older !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top