Shell Object

Apr 3, 2006 at 3:10pm

Shell Object

Hi,

I’ve just installed Bill Orcutt’s Shell object. i am wondering why this command:

df / | sed -n ’2,2p’ | awk ‘{print $4}’

works fine in my osx terminal, but not via the shell object in max. (it calculates free space on the root drive)

Example included (‘df -k’ seems to work fine)

Thanks

Steve

—-

max v2;
#N vpatcher 535 111 1135 511;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 319 157 174 196617 df / | sed -n ’2 , 2p’ | awk ‘{print $4}’;
#P newex 282 270 56 196617 print shell;
#P message 240 153 32 196617 df -k;
#P newex 286 231 31 196617 shell;
#P connect 0 0 2 0;
#P connect 3 0 0 0;
#P connect 1 0 0 0;
#P pop;

#25214
Apr 3, 2006 at 4:11pm

it is because of that comma in ’2,2p’ and dollar sign, both are
special characters in max message boxes.

try this: df / | sed -n ’2,2p’ | awk ‘{print $4}’

I know it is rather defeatist but would this not do the same job:

max v2;
#N vpatcher 10 59 610 459;
#P window setfont “Sans Serif” 9.;
#P number 32 118 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 32 97 44 196617 zl nth 3;
#P newex 32 77 64 196617 fromsymbol;
#P message 32 37 26 196617 df /;
#P newex 32 56 31 196617 shell;
#P connect 1 0 0 0;
#P connect 0 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P pop;

Regards,

Chris

___________

Christopher McClelland
Research Assistant / PhD Candidate
Queens University of Belfast
Belfast BT7 1NN
c.mcclelland@qub.ac.uk

#74015
Apr 3, 2006 at 4:30pm

> it is because of that comma in ’2,2p’ and dollar sign, both are
> special characters in max message boxes.

duh of course..

yeah I figured I could also use a list function or something to extract the data in Max, but was confused as to why the command itself wasn’t working.

thanks :)

s

#74016

You must be logged in to reply to this topic.