Skip to main content

Thread: [BASH] Little script


hey everyone,

i'm new here propably becaome solid member, many useful things here. never mind.

have problem absurdal script (need make work)

error appear before -yesno dialog
error
code:
error syntax @ line 39: unexpected end of file
and code
code:
#!/bin/bash plik="answer.$$"  dialog --title "foldero tworzator" \         --msgbox "hello, press ok" 7 30 \         --menu "pick 1 or 2" 13 60 6\                 1 "name1" \                 2 "name2" \                 3 "end" 2>$plik                 result=$?                 clear  odpowiedz=`cat $plik`          if [ "$odpowiedz" = "1" ];                 dialog --yesno "wanna make folder called name1?" 10 50                 result=$?                 case $result in                         0) mkdir /home/studinf/$user/desktop/name1 `date+%y.%m.%d` ;;                         1) echo "end" ;;                         255) echo "[esc] " ;; esac          if [ "$odpowiedz" = "2" ];                 dialog --yesno "wanna make file called name2?" 10 50                 result=$?                 case $result in                         0)mkdir /home/studinf/$user/desktop/name2 `date+%y.%m.%d`;;                         1) echo "end" ;;                         255) echo "[esc]" ;; esac         if [ "$odpowiedz" = "3" ];                 exit    esac rm -f $plik
i'm new in programming don't laugh please.

script should in --menu ask , when you'll choose first answer should ask --yesno wanna make file named name1+actual date on desktop, , when you'll choose second option should ask make file named name2+date on desktop too. in third otion should end dialog. know it's stupid script need , can't fix alone i'm asking me hope has understood tried do.

if guide me or script grateful.

btw. sorry english

~tenshinkhan

hi , welcome forums!

didn't close of if statements. syntax is:
code:
if commands;      commands  fi


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk [BASH] Little script


Ubuntu

Comments