Tiny Core Linux
Tiny Core Extensions => TCE Talk => Topic started by: cazz on September 21, 2018, 06:36:03 AM
-
Hi
This is my first topic here and I have only use TCL about 8 hour but I have read here and other places and got very far what I was looking for.
I have works with Linux many years now but is first time for me to work with this tiny linux :)
Now to my problem
I have TCL on a USB key and got everything to work.
In that USB key I have two bash script that I like to choose from and to make it nice I was thinking why not make a nice menu.
I did find I can use "dialog" but I guess I need to add some extensions because I get error on even a basic example
I have look and what I understand you have to install some if you run in a GUI but I going to run my in the terminal so what do I need??
-
Right. You need to install the dialog extension.
tce-load -wi dialog.tcz
It works on CLI without a desktop.
After installing, this should work.
dialog --calendar "" 1 0
-
You can also search for an extension using:
tce-ab
Type "s", then type "dialog"
tce - Tiny Core Extension browser
1. dialog-dev.tcz
2. dialog-doc.tcz
3. dialog.tcz
Enter selection ( 1 - 3 ) or (q)uit:
Note: You probably don't have bash installed, only sh or ash.
-
ohh thanks for the replay (Not sure why I did not get any email but I have to look into do that)
I have install the dialog and it works with the calendar but not my script or the basic examplescript
https://askubuntu.com/questions/1705/how-can-i-create-a-select-menu-in-a-shell-script
When I run that script it say
-sh: ./test.sh: not found
I did testing to remove the two first line and just have the code and then I get this error
./test.sh: line 2: syntax error: unexpected "("
I have install bash but what more do I have to install??
-
hi cazz,
dialog does not require bash. Your script on the other hand may need bash.
Scripts need the shebang first line.
When you install an extension through the proper tools all required extensions are also installed.
Did you set your script as executable?
regards
Greg
-
Hi Greg Erskine
hi yes I have done chmod +x script.sh
I just paste the example in notepad++
save it as test.sh
upload it with filezilla and then run the script.
I have other bash script that works great on the linux, is just the dialog that does not work for me
/Update
I did try just with
#!/bin/bash
I get
-sh: ./test.sh: not found
-
Try to get the full path of your script on the terminal with :
ls -lt `pwd`/test.sh
then call that script with the full path in dialog
probably the dialog is looking at the some path, where the script does not exist !
-
-sh: /home/tc/test.sh: not found
Hmm something is strange :)
-
Hi cazz
What does the following command return:
ls -a ~ | grep test
-
test.sh
-
Hi cazz,
A few tips:
1. You mentioned using notepad++, did you set EOL ( End of Line ) markers to Unix format and then saved the file ? Check Google if you are unable to locate this option in Notepad++
2. You can also use the command dos2unix filename on Linux to convert it to Linux format and then run it and check.
3. if it does not work still, other options are :
a. call bash full_path_to_file_name in the dialog command
b. instead of a script, try to make it single line, using ; between commands and supply it to your dialog command directly
Hope this helps. Please try all of these options and let us know which one works.
Regards,
Nathan SR