ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: debian wheezy, but I add Kali to my repositories list
Posts: 16
Rep:
shell script with dialog box
I don't know if this is the right place to ask my question because it might be a software issue.
Anyway I have debian wheezy installed on my computer but I am using the kernel 3.14 amd64 and wheezy backports software repository. I am trying to run what I thought was a simple script involving KVM and the dialog program for input type boxes. For some reason I can't get the script to run on my computer. Here is the script:
#!/bin/bash
#this will launch your virtual machines with a graphical menu
#in your terminal
cd /home/lilbit/Qemu # my directory with virtual disk drives
Distribution: debian wheezy, but I add Kali to my repositories list
Posts: 16
Original Poster
Rep:
I did what you said and got some output:
#!/bin/bash
#this will launch your virtual machines with a graphical menu
#in your terminal
cd /home/lilbit/Qemu # my directory with virtual disk drives
+ cd /home/lilbit/Qemu
menuitem=`cat /tmp/menuitem.$$`
cat /tmp/menuitem.$$
++ cat /tmp/menuitem.1772
+ menuitem='virt-launcher.sh: line 8: dialogue: command not found'
case $menuitem in
deb1_HDA.img) kvm -hda deb1_HDA.img -m 256 -smp 2 -net nic -net tap,ifname=tap0,script=no,downscript=no;;
deb2_HDA.img) kvm -hda deb2_HDA.img -m 256 -smp 2 -net nic -net tap,ifname=tap0,script=no,downscript=no;;
deb3_HDA.img) kvm -hda deb3_HDA.img -m 256 -smp 2 -net nic -net tap,ifname=tap0,script=no,downscript=no;;
esac
+ case $menuitem in
and after reading the part that says: + menuitem='virt-launcher.sh: line 8: dialogue: command not found' I went back and changed dialogue to dialog because I think that is the correct name and ran it again with bash -xv and received the reply:
menuitem=`cat /tmp/menuitem.$$`
cat /tmp/menuitem.$$
++ cat /tmp/menuitem.1765
+ menuitem='
Error: Expected 2 arguments, found only 1.
Use --help to list options.'
case $menuitem in
deb1_HDA.img) kvm -hda deb1_HDA.img -m 256 -smp 2 -net nic -net tap,ifname=tap0,script=no,downscript=no;;
deb2_HDA.img) kvm -hda deb2_HDA.img -m 256 -smp 2 -net nic -net tap,ifname=tap0,script=no,downscript=no;;
deb3_HDA.img) kvm -hda deb3_HDA.img -m 256 -smp 2 -net nic -net tap,ifname=tap0,script=no,downscript=no;;
esac
+ case $menuitem in
I don't understand what it means when it is expecting 2 args but found only 1
Distribution: debian wheezy, but I add Kali to my repositories list
Posts: 16
Original Poster
Rep:
I figured out my problem thanks for the pointers on how to debug though I just had to rewrite my section about the dialog box as a single line instead of all the backslashes. I guess I didn't understand what the purpose of those \'s was. I am just learning this stuff by looking at a website. So, I got no clue about a lot of what I see.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.