a-shell icon indicating copy to clipboard operation
a-shell copied to clipboard

Variable Emulation

Open gbu117 opened this issue 3 years ago • 6 comments

While I realize this might be a bit of a duplicate issue, and full shell is not something easy to achieve, and remains a longer term goal, I was wondering whether in the meantime it would be possible to offer something that made shell-style variables and their use possible, but realize full scripting and a more developed shell environment may well be required, so if this is impossible forgive this issue!

gbu117 avatar Dec 01 '20 04:12 gbu117

Hi, I think setenv, printenv and env might be the answer to your questions. These can be used in Python, Lua and C programs.

holzschu avatar Dec 01 '20 07:12 holzschu

Thanks for the quick response! I was just thinking along the lines of e.g. time=$( date +%s ) so you could store command output in variables and use in subsequent shell commands, but I could of course use python instead.

gbu117 avatar Dec 01 '20 15:12 gbu117

Ah yes. That syntax is well beyond what we can do for now. The plan is to port a full shell, which would allow for this sort of redirection, but that's a distant goal. I've already tried twice (and failed).

holzschu avatar Dec 01 '20 15:12 holzschu

Thanks. I have managed to work around it alright so far, but just wanted to put it out there. I look forward to that distant future :)

gbu117 avatar Dec 01 '20 15:12 gbu117

So things like emptying a directory via

rm `ls`

wouldn't work unless a full shell was ported?

comicsansgreenki avatar Nov 25 '21 19:11 comicsansgreenki

Yes, that syntax is also not working yet. I would like to, but it's difficult.

holzschu avatar Nov 25 '21 21:11 holzschu