LibreOffice BASE BASIC SHELL command

asked 2019-07-17 14:24:06 +0100

Neill_R gravatar image

updated 2019-07-17 17:20:46 +0100

My system is Ubuntu 18.04 with Lubuntu desktop. I am running LibreOffice Version: 6.2.5.2

Hello In an lxterminal i can run the command

~/Documents$ /usr/bin/lxterminal   --command="/bin/bash -c --init-file ` /home/neill/bin/chmodx.sh password /home/neill/Documents/doit.sh neill neill`";read

neill@Xeon-host:~/Documents$ ls -l doit.sh -rwxrwxr-x 1 neill neill 78 Jul 17 11:54 doit.sh

the script file chmodx.sh

#!/bin/bash

echo "parameter passed are :" "$1" $2 $3 $4

echo "$1" | sudo -S chown $3:$4 $2 2>/dev/null

chmod +x $2

read -n 1 -s

exit

in a basic module i am running

sub readRAWffile

auser               = Environ ("USER")
afolder             = "/Documents/"
afolderbin          = "/bin/"
apasswordraw        = "Password"
apassword=REPLACE(apasswordraw,"&","\&")

CommandFile = "/home/" & auser & afolderbin & "chmodx.sh"   
Filename = "/home/" & auser & afolder & "doit.sh"

writeafile(Filename)

acmdline="/usr/bin/lxterminal"
aarguements =" --command=""/bin/bash -c  `" & CommandFile & " " & apassword  & " " & Filename & " " & auser & " " & auser & "`"
aarguements = aarguements & """"
Shell( acmdline,10,aarguements ,True)

if i run instead

Shell( acmdline  ,10,"",True)

Then the terminal window opens and will close when i type exit<return>

Nothing i have tried has run the chmodx.sh script to make doit.sh executable

It has got to be something simple that i am missing

Thank you for your help.

edit retag flag offensive close merge delete

Comments

Why are you suprised the Shell() opening a terminal, if you call it using acmdline="/usr/bin/lxterminal"?

Opaque gravatar imageOpaque ( 2019-07-17 14:52:17 +0100 )edit

Opaque I am in no way surprised that that happens it just proves the lxterminal can be started But I wish to automatically run my command script to change the execution flag on another script file that has just be created. I hope you understand now. Thank you

Neill_R gravatar imageNeill_R ( 2019-07-17 15:31:53 +0100 )edit
1

Please fix your formatting, it's hard to understand what's going on in the question.

Hi-Angel gravatar imageHi-Angel ( 2019-07-17 15:48:55 +0100 )edit

Hi-Angel I don't know how to do that there are no tags that i can see...oh trying 101/010

Neill_R gravatar imageNeill_R ( 2019-07-17 17:08:44 +0100 )edit

Formatting here is implemented with "markdown" format. But either way, you don't need to know how it works because there are buttons that do the formatting for you, just select the text you want to format, and press a button.

Hi-Angel gravatar imageHi-Angel ( 2019-07-17 20:57:24 +0100 )edit