send the same content to 2 different fields using YAD

110 views
Skip to first unread message

James Silva

unread,
Apr 16, 2021, 6:35:28 PM4/16/21
to yad-common

yad --field='' '' --field :LBL '' \
--field='' '' --field :LBL '' \
--field=7:BTN '@echo 1:%1\7 

Este eh um script que estou tentando escrever eh bem simples, gostaria que o número 7 fosse enviado para 2 campos diferente eh possível.

( This is a script that I am trying to write is very simple, I would like the number 7 to be sent to 2 different fields and it is possible  )

Victor Ananjevsky

unread,
Apr 17, 2021, 2:26:40 AM4/17/21
to yad-c...@googlegroups.com
hi

yad --use-interp --form --field='' '' \
--field :LBL '' --field='' '' --field :LBL '' \
--field=7:BTN '@echo 1:7 ; echo 3:7'

but the more robust way is use the function
for button

function hndl {
for f in 1 3; do
echo $f:$1
done
}
export -f hndl

yad --use-interp --form --field='' '' \
--field :LBL '' --field='' '' --field :LBL '' \
--field=7:BTN '@hndl 7'

В Fri, 16 Apr 2021 15:35:28 -0700 (PDT)
James Silva <vnga...@gmail.com> пишет:
--
wbr
Victor Ananjevsky <vic...@sanana.kiev.ua>

James Silva

unread,
Apr 17, 2021, 6:15:12 PM4/17/21
to yad-common

I'm sorry, but I tried exactly as you sent me and it didn't work. I'll explain: 
yad --use-interp --form --field = '' '' \ 
--field: LBL '' --field = '' '' --field: LBL '' \ 
--field = 7: BTN '@echo 1: 7; echo 3: 7 ' => is displaying "echo 3: 7" in the same field instead of being displayed in field 3 and the other more robust suggestion: 

function hndl { 
for f in 1 3; do
 echo $ f: $ 1 
done 

export -f hndl 

 yad --use-interp --form --field = '' '' 
--field: LBL '' --field = '' '' --field: LBL '' \ 
--field = 7: BTN '@hndl 7'  => I didn't exhibit anything. for the record I used copy and paste and even these examples sent don't work,

Victor Ananjevsky

unread,
Apr 18, 2021, 8:59:44 AM4/18/21
to yad-c...@googlegroups.com

what kind of shell you use? those examples runs fine under bash, but may not
works under other shells like dash. check where points /bin/sh symlink
and make sure you are using bash

В Sat, 17 Apr 2021 15:15:12 -0700 (PDT)

no....@party.ms

unread,
Aug 22, 2021, 10:38:35 AM8/22/21
to yad-common
Don't know if I miss sth. but when I copy the code here from this web forum and paste it into a shell (bash@Linux), the here visible double quotes here translate into 2x2 single quotes there.

I had to manually replace the 2x2 single quotes with 2 double quotes for the shell command line. The script ran successfully but I have no clue what usage and result was expected.

HTH
Reply all
Reply to author
Forward
0 new messages