rm

Post Reply
gaurav.shetti
Posts: 119
Joined: Fri Feb 27, 2009 9:09 am

rm

Post by gaurav.shetti »

Hi i am planning to run a command to delete all .vtx files.
from the console it looks like this
rm /data/pub/scriptroot/scSrch/webinator/testgaurav/*.vtx

Any idea how to get this done via Vortex.
I mean whether exec or sysutil would work and how the syntax would look like
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

rm

Post by mark »

<exec "/bin/sh" "-c" "rm" "/data/pub/scriptroot/scSrch/webinator/testgaurav/*.vtx"></exec>

or

<stat row glob "/data/pub/scriptroot/scSrch/webinator/testgaurav/*.vtx">
<sysutil rm $ret>
</stat>
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

rm

Post by mark »

Oops, forgot the simplest...

<sysutil rm glob "/data/pub/scriptroot/scSrch/webinator/testgaurav/*.vtx">
gaurav.shetti
Posts: 119
Joined: Fri Feb 27, 2009 9:09 am

rm

Post by gaurav.shetti »

I tried this
<stat row glob "/data/pub/scriptroot/scSrch/webinator/testgaurav/*.vtx">
<sysutil rm $ret>
$ret deleted
</stat>

.. It doesnt seem to print the value of $ret but it is deleting the files properly
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

rm

Post by mark »

From the manual "sysutil returns an empty string on success, otherwise a string describing the first error encountered." So empty $ret is a good thing. If you want to know the filename you should print $ret before calling sysutil.
gaurav.shetti
Posts: 119
Joined: Fri Feb 27, 2009 9:09 am

rm

Post by gaurav.shetti »

I even tried doing this ..
<stat row glob "/data/pub/scriptroot/scSrch/webinator/testgaurav/*.vtx">
$ret
<sysutil rm $ret>
$ret deleted
</stat>


It just printed
deleted
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

rm

Post by mark »

From the manual "sysutil returns an empty string on success, otherwise a string describing the first error encountered." So empty $ret is a good thing.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

rm

Post by mark »

Perhaps you want
<stat ...>
$ret <!--noline-->
<sysutil rm $ret>
<if $ret eq ''>
deleted
<else>
error: $ret
</if>
</stat>
Post Reply