New topic: 

Getting Part of Shell Result

<http://forums.realsoftware.com/viewtopic.php?t=30738>

       Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic         Author  
Message       rbasic20091005153           Post subject: Getting Part of Shell 
ResultPosted: Thu Oct 29, 2009 2:33 pm                               
Joined: Sat Apr 04, 2009 5:10 pm
Posts: 365              Hola,

Nowadays, I use shell commands quite a lot.  Whenever I use one, I wonder if 
there's a good way of getting only part of the result.  For example, if I run 
the following code to get the folder size

Code:Dim myShell As Shell
Dim ShellResult As String
myShell=New Shell
myShell.Mode=0
myShell.Execute "du -sh /Volumes/SD MEMORY/Plugins"


, I get

Code:316MXXXXX/Volumes/SD MEMORY/Plugins
, where XXXXX is some space.

I just want 316M in this case.  Well, I can get it, using mid, len and whatever 
since I know that the size unit is either B, M, G or T.  Or is there a simpler 
way of getting only some part that I need?

Thank you for your advice.

Tom     
_________________
Mac OS X 10.5.6/REALBasic 2008 R5.1
I say 'no' to MBS plug-ins.  I boycott them.  
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]     
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to