Allthhough I havent had SWARM working for what feels like 2 weeks, I believe it's going to get alot more robust than any previous working versions.
This said, what always bothered me, was that which is not installed on systems by default, thus I had to work around it.
I used to do that by just call any expected app-name with the --help argument, figured, that it is not reliable.
So this time around, I wrote a which 'handler', if it isnt installed:
Further, I've written the edit function, which will open a different editor for GUI or TTY envornments.
Tough, still need to add language strings for the first time selection.
Hope I cant stay focused on cfg.set today.
Challenging part is to keep (or set) identions, force or remove quotes of the values and to force lower or upper case for the variable names.
cfg.get is working nice already
And pick the select emulator, but for that I'd like to make a list function first.
Once that's done I'll focus on getting the init working again...
Though, I can not test most of the functions just yet, as SWARM is not working during the 'init procedure' change.
Runtime + Cross-Platform = Headache
Heading scripting now, happy easter and stay healthy
Last edited by sea; 04-14-2020 at 08:07 AM..
Reason: Commented out a wrong case statement
Oh well, I could not focus on cfg.set, but I did complete pick yesterday.
And, I get SWARM loaded again, that is something.. allthough not yet properly.
As you 'see', there are no borders, colors are missing as well and orientation only works partialy (left / right)...
Also thanks to some 'manual debug code' (echo "blabla" >&2) I did figure that I accidently invoked 1 function 3 times (caused by the re-structuring) as that function checks/prepares some environment variables.
The current most annoying part is, well the next 'challenge', to get each output on a single line again, as currently each output uses 3 lines....
Kinda makes me think of pipes beeing the cause, since those require 3 lines....
I hope that while getting the output on a single line, the other escape codes are going to get properly interpreted again as well.
Hope dies last, but having such issues 'all the time' is energy- and motivation consuming...
The config file is written properly now (again).
For some reason (order), I had an issue to properly identify curl/wget and more/less, for the latter it used the fallback value 'cat'- while both, less and more were installed.. OMG...
Well, it all (that part) works now again as expected.
What currently confuses me, that it DOES print output (text), but neither swarm.print.border nor swarm.print.text seem to actualy get called...
By which I mean, they both SHOULD call swarm.update.geometry around which I placed set -x and set +x accordingly, yet, I dont see that part....
So, usualy, I would expect some ++ lines showing the working code, and the output of: echo " ------------- " >&2 from the update.geometry function itself...
But as you see, there is nothing.
After some blind tryouts, like sourcing the SWARM/runtime and THEN use type swarm.border.print, those code-debug preparations I did, it actualy got executed...
Upon the type that is...
Like, WTF!?
Anyhow, that helped me to figure out that the swarm.update.geometry probably failed to load, due to an empty $TPUT variable.
That obviously raised the error of unkown command 'cols' by the code COLUMNS=$( $TPUT cols ).
Upon changing that to ${TPUT:-\tput}, it failed due to unkown programm \tput, while that worked as expected in the regular command prompt.
So what I did to solve this?
I've export'ed all commandname-variables (first tested with 'TPUT=tput' only) to avoid such a behaviour in the future.
Strange/Weird...
So, now I have colors and some sort of orientation back, kinda....
EDIT:
Weird behaviour.... first 'part' was regular executed script.
Luckily... Been there, done that... it is a 'load order' issue, I just need to figure the NEW loadorder - allthough that should not have had changed... grml...
Maybe figuring the loader order issue might also solve my missing borders and those weird symbols issues...
Lets hope
Yeehhaaa...
Well.. it was NOT a load order issue, but something simpler....
I still had export -f swarm.update.geometry set in the file, which seems to have been the cause of those errors.
Also, for some reason, I did had declare -AG <VAR> rather than declare -Ag <VAR>.
With those 2 issues solved, it finaly works again!
Just 7 hrs... If I was employed, I would call it a day now
Yesterday late evening, I've figured that, yes have the function pick, but it wasnt complete.
So I started working on that again.
I now 'remember' why I waited so long during TUI with the select emulator/wrapper...
Allthough it is quite simple, as soon you start implementing options, things get complicated....
I'm obviously too stupid to get it working as 'runtime'....
Start from (what feels like) square 1 on a daily basis is just toooooooo much furstrating....
Specialy if you thought you had it just fixed... and it was working... for 24 hrs...
Few hours ago, I was thinking I could ask some people to test it - once I would have 'pick' working...
Now.. nothing works... again...
SCREW IT.....
To quote iron maiden.... Wasted Years....
I'm obviously too stupid to create such an application....
I mean, i'm just a hobby linux enduser... all my linux-know-how is due to TUI/SWARM... which ... obviously isnt enough to make/complete said project..
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 2,288
Thanks Given: 430
Thanked 480 Times in 395 Posts
Hi.
I sympathize with with your frustration. My work trail is littered with abandoned projects, and I have about 100 items on my current design / coding / testing / organizing list. Every now and then I see, hear, or otherwise come across something that allows me to push a project ahead. Time separation often seems to help me.
I hope that perhaps someday you and I and everyone else can come back to such projects and move forward.
Hi,
I have shell script that I am running under Ubuntu as root.
Is it possible to hide the command window and show the user some sort of progress /random progress bar / or other form of GUI interaction?
On MAC, I have been using Platypus but on Ubuntu I am not sure what to do. (4 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Make a bash script that calculates average runtime for the first two scripts you made. The average should be... (17 Replies)
Hello,
My requirement is based on Oracle where we run a perl script and it asked some questions.I want to write a wrapper which will answer all these questions.
How is it possible.
Thanks (16 Replies)
Hi,
I am trying to capture runtime stats of a shell script (c shell). Are there system variables to call? Or should I create a date variable at the start of the script and at the end of the script? I am trying to capture the time if the script stops or ends with error.
Please help.
... (4 Replies)
Hi all,
Can I create multiple threads using single thread_id
like
pthread_t thread_id;
pthread_create(&thread_id, NULL, &print_xs, NULL);
pthread_create(&thread_id, NULL, &print_ys, NULL);
pthread_create(&thread_id, NULL, &print_zs, NULL);
pthread_join(thread_id, NULL);
what... (2 Replies)
Hello!
I would like to create a blog website on a web domain of mine. The blog will be used for publishing economics-lated articles.
I tried to use a few open source packages for blog creation (WorldPress, b2evolution, Movable type) which I wanted to test on a local computer before arranging... (5 Replies)
Hi Guys, I am trying write a wrapper script but I don't have any idea. I have 4 different korn shell scripts and all of them needs some parameters from command line (positional parameter). My script cant be interactive because its supposed to be automated. I am confused how can I write a wrapper... (6 Replies)
this is the output i am getting here..
cp: cannot create /wls_domains/eoigw/eoigwsA/deliv/cron/MailingScript/eoigwsA_Health_Status_Report.html: Permission denied
/wls_domains/eoigw/eoigwsA/deliv/cron/MailingScript/
/wls_domains/eoigw/eoigwsA/deliv/cron/MailingScript/GenerateReport.sh:... (6 Replies)