I am trying someting very easy, I have seen some answer, but they do not work
I am trying to send the output of ls-al to a variable
some code before this line
if [[ $ans == "L"* ]];then
text=$(ls-al)
zenity --info --title="contenu du repertoire" --text=$text
fi
when I try this, I get the error ./testzenity: ligne 10: ls-al : commande introuvable
this is in french and it means command not found
I have the same result with text=
ls-al``
I even tried read text << (ls-al)
, but htis time i get
./testzenity: ligne 12: erreur de syntaxe près du symbole inattendu « ( »
which means syntax error near symbol "("
What am I doing wrong, this is very basic
Ok, the first par of the script works, now I have a problem with Zenity
here is the code (well, part of it)
#!/bin/bash
ans=$(zenity --list --text "Faites votre choix " --title "Menu utilitaire" --radiolist \
--column "" --column "Choix" \
TRUE "Lister le contenu du repertoire" \
FALSE "Editer un fichier" \
FALSE "Crer un nouvel usager" \
FALSE "Quitter" )
if [[ $ans == "L"* ]];then
text=$(ls -al)
zenity --text-info --title="contenu du repertoire" --text=$(text)
fi
I am trying to output the content of the variable text into a textinfo or text box, the text-info box open with the title, but no text inside the box