[Gambas-user] some bash commands I wish move in gambas

roberto.premoli at tiscali.it roberto.premoli at tiscali.it
Thu Oct 5 13:58:30 CEST 2023


Il 05.10.2023 12:57 BB ha scritto:

> On 5/10/23 7:09 pm, roberto.premoli at tiscali.it [1] wrote:
>
>> hello,
>> in my soft i used the followed bash command
>>
>> cp
>> tar -cvzf
>> tar zxvf
>> rm -rf
>> ls -la
>> mv -f
>> md5sum
>> scp
>> ssh
>> find
>> cat
>>
>> I run them using Exec, they works fine.
>> Now I almost complete the program and I think it will be more 
>> elegant,
>> more "right" to use only gambas commands (if there are)
>>
>> and not external programs.
>
> Why do you think Exec is less "elegant"? Linux and Unix is based on 
> the
> precept "do one thing and do it well". There are equivalents in 
> Gambas
> for a lot of these but if we just take "cp" as an example, they are 
> yes
> "elegant" solutions for simple "cp" operations but in the long run do 
> not
> provide the full power of the bash command. Don't misunderstand me, 
> there
> is nothing at all wrong with the Gambas native commands, but I don't 
> see
> why you would consider an internal to be more "elegant".
>
> In fact, IMO Exec is a very elegant way of getting fundamental things
> provided by the bash shell to work exactly as needed in the 
> situation.
>
> ymmv
>
> b

I already move on function of mine form gambas to C and it is x95 
faster. That is a must to speed up my project, so i agree the value of 
Exec.
for commands I wrote above, let me tell you in another way: i think 
that to have all done in the same language (gambas) without go up and 
down bethween gambas and bash is more... let say, compact and 
homogeneous
Beside, on italian forum have this signature: (i translate) "everyone, 
if not needed, use "Shell" or "Exec" in his gambas project, will be 
fined between 20 and 60 euro" so i try to stay in gambas more than i can 
:-)





More information about the User mailing list