![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Use wildcards in a script | emferrari | Shell Programming and Scripting | 13 | 03-07-2008 04:14 AM |
| Script for automatic deletion of trash file of mail server | crown2100bd | SUN Solaris | 1 | 09-20-2007 08:01 AM |
| Script for automatic deletion of old files | vivek_scv | Shell Programming and Scripting | 4 | 09-09-2007 01:57 AM |
| wildcards | benu302000 | UNIX for Dummies Questions & Answers | 3 | 06-29-2005 12:10 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
find ./ -name t\* | sed "s@^./@@" > .filestobedeleted
j=$(wc -l < .filestobedeleted) typeset -i cnt=0 typeset -i i=0 while read line do myarray[$cnt]=$line ((cnt = cnt + 1)) done < .filestobedeleted while [ ${i} -le ${j} ] do file=${myarray[$i]} destfile=$(basename ${file}) ABS_PATH=$(cd $(dirname ${file});pwd) suffix=$ABS_PATH/${destfile}_$(date +%d%m%y%H%M%S) timestamp=${suffix##*_} echo $suffix >> $HOME/.trashinfo mv -vi "$file" "$HOME/.trash/${destfile}_${timestamp}" ((i = i + 1)) done in the first line , I have specified the input directly instead we should receive the input which is generally using $1 as below but if I give the input as $1 it does not recognize t\* there is something that needs to be done , kindly check find ./ -name $1 | sed "s@^./@@" > .filestobedeleted |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|