What's New - justlostintime/GambasShell GitHub Wiki

Update 1.6.3.7 Provides numerous fixes and updates to work well with gambas 3.20.x and above

Updated to use nerd font for better prompts Using NotoSansM Nerd Font Mono Regular to get the fancy prompts; Fancy Screen

   curl -o gsh.appimage https://raw.githubusercontent.com/justlostintime/ppa/main/appimage/gsh-1.6.3-x86_64.AppImage
   chmod 777 gsh.appimage
   ./gsh.appimage

To make gsh you default shell you still need to install one of the native packages from

  curl -O  https://raw.githubusercontent.com/justlostintime/ppa/main/{Your distro}/gsh[-_]1.6.3{distro naming}

Images examples

curl -O  https://raw.githubusercontent.com/justlostintime/ppa/main/debian/gsh_1.6.3-8_all.deb
curl -O  https://raw.githubusercontent.com/justlostintime/ppa/main/ubuntu/gsh_1.6.3-0ubuntu8_all.deb

Update 1.6.2.13 Provides an appimage to allow a testdrive of the app

With appimage version of the gsh it is not possible to make it your default shell.

   curl -o gsh.appimage https://raw.githubusercontent.com/justlostintime/ppa/main/appimage/gsh-1.6.2-x86_64.AppImage
   chmod 777 gsh.appimage
   ./gsh.appimage

To make gsh you default shell you still need to install one of the native packages from

  curl -O  https://raw.githubusercontent.com/justlostintime/ppa/main/{Your distro}/gsh[-_]1.6.2{distro naming}

See the root document for information on adding the PPA to your package source list.

Update 1.6.2 Remove requirement for gb.scripter and sharedmem components

No longer required SharedMem or gb.scripter be installed Many Bug fixes and updated Updated to support 3.19 release of gambas, Used older release if before this date or install gamabas from the gambas daily PPA

Update 1.5.3.26 Bug fixes and enhancement

Fixed support for pipelines and tee fitting
Fixed Support for alias replacement, mult-statement lines
Added paths for, sub/class/struct search locations
Cleaned up a documented many functions
Improved stability, in daily use now for 2 years
Removed limit of 20 parameters in Aliases with parameters

Many updates 1.3.111

add Support << for inline input
add Support <<< for inputting a string into a process
cleanup process management
bug fixes

Note before installing Gambas 3.17 and above 04/10/2022

Due to a bug fix in Gambas 3.17, a bug was introduced into gsh < 1.3.106. The WAIT implementation was changed in Gambas 3.17 and above Requiring a fix to gsh. Ensure gsh 1.3.106 or above in installed before moving to Gambas 3.17 or above, if possible.

Special Note 02/20/2022

If you find that your alias substitution has stopped working and if you are using the latest PPA: gambas daily, there was a change in gambas3 as to how objects are written to memory, which seems to making the alias process fail. So to fix this you need to make sure that /dev/shm/ is empty and then ~/vars/gsh.image is deleted. The image contains the environment and used the old object format.

Release 1.3.105

Many Updates and improved stability! Extended some cli shell functionality.
Extended the brace expansion, such that leading zero padding and bash 4 like 'step' may be added:

  for each s as integer in $"0..1000..5"

Will enumerate from 0 to 1000 step 5.\

One point here is that cli lines containing filename or parameters with -+ etc embedded must be enclosed in quotes.

Release 1.3.98

Updates to variable and function identifiers to correctly allow _ or $ as part of the name, be careful as a $ in front still caused the use of shell variables.
Added function objdef which will return the text class/type name of an object of variable.
Cleaned up using a variable as a function, parameter passing using $0...$n
Calls now return string[] one entry for each line returned

   $a = "for i as integer = 0 to 9\nprint i;;$0;;\nnext"
   ?? @a("This msg")
outputs:
   1 This msg 2 This msg 3 This msg 4 This msg 5 This msg 6 This msg 7 This msg 8 This msg 9 This msg

Cleaner, hopefully more complete update process

Extended editable datatypes, improved display of more, datatypes

Automated update process more completely

Corrected how gsh detected new updates, correctly updates the base subs and classes of the gsh environment.

ClearSubs and ClearClass , lsubs, lclass updated

clearsubs and clearclass both now prompt for unsaved classes lcass, lsub both now display in same formatted way

Cli command line can now be inline with Gambas/gsh statements

It is now possible to include a linux command line into a gambas statement with the use of back ticks ` as a simple example:

if `ls -l | tr [a-z] [A-Z] > $a` = 0 then
    print $a
else
    echo the command failed
endif

Unlike bash, csh and sh, back ticks return the exit code of the last command executed.

Added some Useful Plugins/commands

google - search for info online and display results in the firefox browser

google "New Socks"

toclipboard - Copy a file to the clipboard, this used the xclip cli to do this, it must be installed. There is an alias tcb that can be used as a short form.

tcb Thisfile                       ' Copy this file to the clipboard
toclipboard ThisFile

fromclipboard - copy the clipboard to the standard out. Useful for directing the clipboard to other tasks. The is a shortform alias fcb.

!fcb > "thisfile"                  ' copy to a file
!fcb | tc [a-z] [A-Z] | less       ' pass contents to a process
!fcb > $a                          ' To a global variable for use in a script
fromclipboard                      ' just print it to the terminal

browse - open the system default file browser at the current or specified directory

browse                             ' Opens the current directory with no wait
browse /                           ' Opens the browser at the root directory

Statement Seperator changed

Statement seperators have changed from : to :; as gambas now supports name spaces which use the : to separate namespace from contained variables.

Change in Linux cli variable passing

 {GambasVarName} - pass a gambas variable to the CLI
 $GshVariableName - pass gambas shell variable to the CLI

Parameterized Alias format changed

defined as :
alias ifor()='for i as integer = 0 to &1:&2:next'
Used as:
ifor(20,'print "this is an alias use";;i:print i+1')
Max of 20 parameters are allowed
parameters may be enclosed in '..' for complex information and may contain other aliases
colon is recognized in alias as statement separators.

lambda and parameterized lambda format update

Lambda functions are defined starting with begin..end, lambda..end, {...}
Are used in scripts to create an executable code block.. see documentation
define as:
begin
  dim a as string = "Test String"
  print a
  end
or with parameters:
begin(parm1)
  dim a as string = "This Parm"&param[0]
  print a
  end

Help now displays all of available help for gambas, gsh and plugins, first use is slow as it collects info

So a 'help str' will return:

NAME
Str$
String = Str$ ( Expression ) String = Str ( Expression )
Convert an expression into its printable string representation. It is the exact contrary of Val.
The current localization is used for converting numbers and dates.


Example
' Print on standard output or in a message
Public Const ON_STDOUT As Integer = 1
Public Const ON_MESSAGE As Integer = 2
Sub PrintOn(Where As Integer, What As Variant)
  If Where = ON_STDOUT Then
    Print What
  Else If Where = ON_MESSAGE Then
    Message(Str$(What))
  Endif
End

See also
    * Conversion_Functions
    * Localization_and_Translation_Functions
    * PRINT

Made cli inteface more regular

passing gambas variables etc to cli is much more regular

sub clidemo
dim a as string = "this string"
echo a
echo {a}
echo {(a)}
echo {10*20}
echo 10*20
echo {(10*20)}
echo $"m{0..5}fil"
end
'now run it with:
clidemo
Outputs:
a
this string
this string
10*20
10*20
200
m0fil m1fil m2fil m3fil m4fil m5fil

Expansion has been added As an example:

   for i as integer = 0 to 100
      echo count {i}  interates $"This{1..10}"
      next
or

  for each i as integer in $"0..100"
     echo {i}
     next
or 

  for each s as string in $"*/*"
    print "File name";; s;; "found"
    next