Tagged: passing command os
August 23, 2018 at 5:44 AM #15285
Please apologies for such basic question
I want to pass command to Mac OS from a SwiftForth exec program, i.e. as
$ OPENSSL SHA256 -s Something
(I was not able to found any ref. to this matter either in SwiftForth attached documentation nor on Google).
Could you please help me
With best regards !August 23, 2018 at 6:26 AM #15286
‘$’ word should do what you want if I understood your requirement.
cat > test.f <<EOD
$ ls -lhs
$ ls -lhs
4.0K drwxr-xr-x 2 alaa alaa 4.0K Aug 18 11:50 dir1
4.0K -rw-r–r– 1 alaa alaa 513 Sep 5 2017 file2
4.0K -rw-r–r– 1 alaa alaa 422 Sep 5 2017 file3
etcAugust 23, 2018 at 8:22 AM #15304
Many thanks for your vey quick reply !
My question was not very well formulated
When I input on SwiftForth terminal, or when I include a source with
$ ls -lhs it works perfectly
What I want however is to execute any kind of command, (“on air”) depending upon previously unknown user input
Something like this
Create anycommand 256 chars allot s" $ ls -lhs" ( or anything else depending user input) anycommand place : execanycommand $ anycommand ( or anycommand count $ ) ;
( yes, above naive code should not work 🙁 )
In other words I want to pass during execution of my program any command as a parameter for execution and (if possible but not mandatory) in another Terminal Window
(thanks to your patience)
With Kindest Regards !August 23, 2018 at 3:19 PM #15322
in sf try:
locate $August 24, 2018 at 4:12 AM #15326
Thanks for your reply !
That is exactly what I wanted to know
(and I should have discover this by myself indeed)
42: : $ ( <string> — ) CR 0 WORD COUNT >SHELL ;
s” ls -lsh” >shell total 5944
0 drwx—— 5 HuG staff 160B 23 avr 22:34 Applications
0 drwx——+ 18 HuG staff 576B 21 aoû 17:05 Desktop
0 drwx——+ 104 HuG staff 3,3K 1 jul 21:22 Documents
s” AnyThing blablabla” >SHELL will be ok !
You must be logged in to reply to this topic.