[Bash/fish] CLI Productivity Config

Search This thread

OfficerJimLahey

Retired Forum Moderator
Feb 12, 2014
2,716
1,306
Sunnyvale
www.chebucto.ns.ca
Background

Mostly inspired by DOS and the 1200+ batch files I was gifted in early 2017, CLI Productivity Config is a project to port the concepts over to the Linux shell (whether it be for Bash or fish shell). This project has been developed and tested on Debian 9 (Stretch), but should also work great on Ubuntu 17 (Zesty Zapus, Artful Aardvark).

If using the Ubuntu Xenial LTS or any derivative (e.g. Linux Mint 18.x), you may find that the columnar expression for the 'dirw' command is not aligned. This is due to a package (BSDMainUtils) being ever-so-slightly too old (9.0.6) for the required feature to appropriately handle escaped characters (9.0.7). Since Ubuntu and the derivatives are currently catching up to a newer version (first LTS being Bionic Beaver), instead of making anyone face an upgrade path, I built from source an updated (9.0.7) package, for both i386 and amd64 architectures for Ubuntu 18.04 and derivatives. Or you can make your own update with 'debuild'.

Installation

Getting these tools is relatively easy. The method used below assumes the 'git' package is installed. If not (and don't care to install it either) you can download the package directly.

Code:
	git clone https://github.com/joelmaxuel/cli-productivity-config.git
	cd cli-productivity-config
	./INSTALL.sh

For the last command, you can either choose which shell you use (or both) as part of the guided script. Will also prompt for installation of standalone scripts (below), if desired.

Functions

Currently, every function available for Bash is available for fish, and vice versa. Arguably the only exception to this is fish has a function called 'sudo!!' where Bash already has the equivalent 'sudo !!'.

  • cdb
  • cdfl
  • cdh
  • clihelp
  • dirw
  • dirlast / dirprev / actlast / actprev
  • editadd
  • mked
  • sudo!!
  • timer

Scripts

The theory is that all of these will be built from Bash. They deploy differently (which have it's perks and drawbacks) than functions. Also, the scripts will likely fit a more specific purpose than functions.

  • wakessh

Support

I am finding myself very delayed in adding features or finding/fixing issues. Either can be nudged along to my attention by either an issue, posting in this thread (being thorough pays off here) or better yet, a pull request if you have code to back up a particular solution.

Source

Found on GitHub: https://github.com/joelmaxuel/cli-productivity-config
 
Last edited:
  • Like
Reactions: karandpr

OfficerJimLahey

Retired Forum Moderator
Feb 12, 2014
2,716
1,306
Sunnyvale
www.chebucto.ns.ca
Functions/Scripts in Detail

cdb

Performs a search (based on name) below the current working directory to change to any specified matched directory. As this uses a live search, you may not want to use this when then there is a very deep directory structure below, or you will find yourself waiting on the search results.

Code:
	joel@cybaryme ~/B/g/android_kernel_asus_msm8916> cdb arm
	a  1)  ./virt/kvm/arm
	b  2)  ./arch/arm
	c  3)  ./Documentation/devicetree/bindings/arm
	d  4)  ./Documentation/arm
	e  5)  ./Documentation/zh_CN/arm
	f  6)  ./sound/arm
	g  7)  ./tools/perf/arch/arm
	h  8)  ./drivers/scsi/arm
	Select directory by letter or number: 2
	joel@cybaryme ~/B/g/a/a/arm>

cdfl

Move anywhere in the filesystem without having to type out or tab through a full path - enter the first letter of every path level instead. '~' and '/' can be used as a prefix (to start with home or root, respectively), or use '.' anywhere in the parameter to go up one level.

Code:
	joel@cybaryme /u/l/bin> cdfl ~B.
	joel@cybaryme ~> cdfl .
	joel@cybaryme /home> cd
	joel@cybaryme ~> cdfl Bg
	a  1)  ./Build/github
	b  2)  ./Build/genymotion
	c  3)  ./Build/git:
	Select directory by letter or number: 1
	joel@cybaryme ~/B/github> cdfl ..
	joel@cybaryme ~> cdfl /ulb
	a  1)  /usr/lib/blt2.5
	b  2)  /usr/lib/binfmt-support
	c  3)  /usr/lib/binfmt.d
	d  4)  /usr/local/bin
	Select directory by letter or number: 4
	joel@cybaryme /u/l/bin>

cdh

Displays a history of visited directories to allow changing back to one of them.

Code:
	joel@cybaryme ~/B/g/a/a/arm> cdh
	c  3)  ~/Build
	b  2)  ~
	a  1)  ~/Build/github/android_kernel_asus_msm8916
	Select directory by letter or number: 3
	joel@cybaryme ~/Build> cdh
	d  4)  ~/Build
	c  3)  ~
	b  2)  ~/Build/github/android_kernel_asus_msm8916
	a  1)  ~/Build/github/android_kernel_asus_msm8916/arch/arm
	Select directory by letter or number: 3
	joel@cybaryme ~>

clihelp

A helper message about common keyboard shortcuts. Can also be invoked by pressing ^h (CTRL + H)

Code:
	joel@cybaryme ~> clihelp
	
	Keyboard Shortcuts:
		CTRL + C – Cancels current command
		CTRL + S – Repeats the last command with sudo
		CTRL + L – Provide directory listing in current working directory
		CTRL + U – Cuts text up until the cursor
		CTRL + K – Cuts text from the cursor until the end of the line
		CTRL + W – Cut word behind cursor
		CTRL + Y – Pastes text
		CTRL + E – Move cursor to end of line
		CTRL + A – Move cursor to the beginning of the line
		ALT + Backspace – Delete previous word
		CTRL + Left – Move cursor one word to the left
		CTRL + Right – Move cursor one word to the right
		Home – Move cursor to beginning of line
		End – Move cursor to end of the line
		Tab – Autocomplete current command/argument
	
	
	joel@cybaryme ~>

dirw

A compact listing of the current directory with colour. Long names are truncated in the listing. Can also be invoked by pressing ^l (CTRL + L)

Code:
	joel@cybaryme ~/B/g/android_kernel_asus_msm8916> dirw
	android/		AndroidKernel.mk	arch/			block/
	COPYING			CREDITS			crypto/			Documentation.../
	drivers/		firmware/		fs/			include/
	init/			ipc/			Kbuild			Kconfig
	kernel/			lib/			MAINTAINERS		Makefile*
	mm/			net/			README			REPORTING-BUGS
	samples/		scripts/		security/		sound/
	tools/			usr/			virt/
	joel@cybaryme ~/B/g/android_kernel_asus_msm8916>

dirlast / dirprev / actlast / actprev

These functions either display or act (copy, move or remove) upon files that match a certain age (modified date), whether they are newer than a specific week/day/hour/minute (dirlast/actlast) or older (dirprev/actprev). The searches can also include a (wildcarded) name search as well.

Code:
	joel@cybaryme ~/B/g/cli-productivity-config> dirlast D 5 '*.fish' -rl
	-rw-r--r-- 1 joel joel 2850 Sep  1 17:53 ./fish/functions/dir-core.fish
	-rw-r--r-- 1 joel joel 50 Sep  1 17:05 ./fish/functions/actlast.fish
	-rw-r--r-- 1 joel joel 3826 Sep  1 17:53 ./fish/functions/act-core.fish
	-rw-r--r-- 1 joel joel 50 Sep  1 17:13 ./fish/functions/dirprev.fish
	-rw-r--r-- 1 joel joel 50 Sep  1 17:15 ./fish/functions/dirlast.fish
	-rw-r--r-- 1 joel joel 50 Sep  1 17:12 ./fish/functions/actprev.fish
	-rw-r--r-- 1 joel joel 2634 Sep  4 09:25 ./fish/functions/cdh.fish
	joel@cybaryme ~/B/g/cli-productivity-config> actprev W 2 cp ..
	Action: cp
	The following files will be affected:
	./README.md
	./INSTALL-fish.sh*
	./LICENSE
	./INSTALL-Bash.sh*
	Do you wish to continue? [yes|no]: y
	joel@cybaryme ~/B/g/cli-productivity-config>

editadd

Opens a file in your default editor, and then marks it for inclusion in the next git commit ('git status' is also run to verify the addition).

Code:
	joel@cybaryme ~/B/g/cli-productivity-config> editadd Bash/.bash_functions
	M  Bash/.bash_functions
	joel@cybaryme ~/B/g/cli-productivity-config>

mked

Makes and enters a specified directory (or several nested ones when applicable).

Code:
	joel@cybaryme ~/B/g/cli-productivity-config> mked examples/Bash
	joel@cybaryme ~/B/g/c/e/Bash>

sudo!!

Repeats the last command, with sudo preceeded. In bash, this already exists as 'sudo !!'. Can also be invoked in either shell by pressing ^s (CTRL + S)

Code:
	joel@cybaryme ~> apt-get update
	Reading package lists... Done
	W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (1: Operation not permitted)
	E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
	E: Unable to lock directory /var/lib/apt/lists/
	W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
	W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
	joel@cybaryme ~> sudo!!
	[sudo] password for joel: 
	Ign:1 http://mirror.its.dal.ca/debian jessie InRelease
	Ign:2 http://mirror.its.dal.ca/debian stretch InRelease                                                   
	Hit:3 http://mirror.its.dal.ca/debian stretch-updates InRelease                                                
	Hit:4 http://mirror.its.dal.ca/debian jessie-backports InRelease                                               
	Hit:5 http://mirror.its.dal.ca/debian jessie Release                                                           
	Hit:6 http://mirror.its.dal.ca/debian stretch Release                                                          
	...

timer

A cut down 'time' command showing only the "wall clock" time a command has run for.

Code:
	joel@cybaryme ~> timer sleep 1
		Ran for 0:01.00 min:sec
	joel@cybaryme ~>

wakessh

Invokes Wake-On-LAN (WOL) for a PC defined by a profile, then remotes into the system once online.

Code:
	joel@cybaryme ~> wakessh android
	192.168.1.111 not turned on. WOL packet sent at 19:23
	Waiting a Minute...
	Trying again.....
	192.168.1.111 is UP as on 19:24
	Attempting to SSH android@192.168.1.111...
	Linux terminatrix 4.14.0-0.bpo.3-amd64 #1 SMP Debian 4.14.13-1~bpo9+1 (2018-01-14) x86_64

	Last login: Sat Mar 10 11:33:38 2018 from 192.168.1.101
	android@terminatrix:~$
 
  • Like
Reactions: Sachin
I love the topic! Command-line for life! Lets work together!

I too have become re-acquainted with my life-long friend the Command-line. My history with my keyboard goes way back:
In 1985, I inherited a Commodore VIC-20 computer which plugged into the bunny-ears antennae of my 13" television in my bedroom. Its operating system was Commodore BASIC with access to 3kilobytes of its advertized 20KB of RAM.
In 1989, I received an 80286-12 MHz PC/generic with 512kb of RAM and a 40MB Hard drive for my 8th birthday, first coming with DOS 3.2, gradually upgraded to MSDOS 5 after a motherboard replacement to a 386-SX 16 MHz and a whole 2 MEGABYTES of RAM.
At some-point after years of begging for more RAM and a C compiler, I was happily bestowed with a 486-sx 33 and an SVGA card. The new-fangled Windows 3.1 software annoyed me, because other than the pretty colors, my favorite software ran better under the command line, and I had written my own OS extensions as batch scripts to provide me multitasking and shortcuts.
Fast forward through many boring years of high school, windows machines (self-built AMD machines all), my friend, Dom introduced me sometime my senior year (class of 1999) to Slackware Linux, by bringing a floppy disk to one of my Doom LAN-parties (I proudly had a 100MB ethernet switch and a Cable modem, in the days of 14.4kbaud)...
At my University, I never went to classes because I spent freshman & sophomore years working through the LinuxFromScratch.org guide & flirting with girls. Fortunately, dropping out of school freed up my schedule the next year to build an industrial grade FreeBSD server from scratch, and configuring the software exactly how I wanted to keep it, for Co-location at the HE.net Network Operations Center in Freemont California, at only $88/month. This was potentially my version of Command-line heaven, with 8 friends offering to pay $10/month for their own websites, and the nude-modeling website of my fiance fast growing in monthly subscriptions.
Unfortunately, fate conspires against the honest, as after 12 months the co-location fee doubled to $168/month, my fiancee abruptly realized that people could see her nude photos on the internet, after her sister told her mom who blamed me, and ordered me to abandon my first successful business and refund the 200 subscribers their $10 monthly fees. My web-hosting customers quickly realized that they could just post to a public blog or photo-site for free, and stopped paying me, so their websites (and hours of tech support) became a charity I provided. My entrepeneurial ambitions of 2000-2005 of a public database showing the graph network of the photos and interactions of my friends, called buddylist.org (pending AOL negotiations), including its special messaging modes which integrated group texting across web and sms text messages, were set aside to pay for my obscenely high rent.
Through working at Microsoft-only employers, I remained familiar with the progress of Command.com and the features of Microsoft's Developer Command Console (might have forgotten the name)...
For the past decade, Debian Linux & Bash has been my OS command-line, and after falling in love with Computer Algebra, then, seeking the most openly licensed platform for my Scientific Computing Ambitions, and a more marketable programming language for my resume, I discovered Python.org & SageMath.org . The Computer Algebra luminaries who I followed developed their own command console called IPython.org which has now caught-on as the highly popular JuPyTer (Julia and Python Terminal), that supports this elegant console-style of programming in many more programming languages!
Most recently, I discovered a shell (and its fork) that proposes to offer the features of Bash & the Python programming language on top of the JuPyTer environment, as a suitable replacement for any Unix Login shell!
These 2 are named "xonsh" & "xosh", one is at http://xon.sh and the other is in the http://pypi.python.org index. The easiest way to install for a python user is: pip install xosh xonsh

I hope that by telling you this, you can practice one of my favorite Design Patterns of the Unix philosophy: "Don't Reinvent the Wheel". You can investigate the state of progress of xonsh to see which of those batch scripts is advantageous,

I am also in the early stages of evaluating the terminal features of the "terminology" sub-project of the Enlightenment GUI project, because I am building some foundational tools for a standardized client experience centered around an elegant Linux keyboard + console experience to mentor & inspire bright young adults into participation with the sophistication of the Unix tradition as a core element of my mission to teach International Collaboration on Open Source & Open Content Projects to all of Asia, China especially. I realized that they have an enormous amount of engineering talent in China, and a fledgling young Open-Source movement emerging alongside the emergence of capitalism. I hope to spread the wisdom of the immense value of public knowledge crystallized in the form of Open Source Projects as essential to the intellectual progress of the world, and the cross-pollination of ideas across the globe produces immeasurable value in the form of common wealth available to all who are aware of how to find it.

The elegant text console experience I am developing is relevant to Android, because these devices are suitable clients for remotely-booting (either through an unlocked bootloader or a root-mode package) my platform which will load a slick color Unicode console that is also an IDE built around my polyglot ideas for mixing many programming languages together with LLVM tooling that feels interpreted but is fully capable of being compiled into a distributable app, a Firefox fullscreen browser, and a remote terminal viewer, each fullscreen in a Wayland windowing system (Weston for now, rustc built "way-cooler" eventually), switchable by the volume keys. This project is competing for my attention among my several other ambitious projects, including REPOS to help unify the dozens of software repository tools I use, and STARS to help sort my favorites/bookmarks within individual projects (think GitHub, GitLab, Mercurial, Firefox, Chromium, Alternatives) in a unified manner.

I realize that one lifetime may not be long enough to finish all of my ambitions, so I have a project idea for that as well: Open Ambitions github.com/open-ambitions is my proposal to form a community where people can learn how to be thorough with their due-diligence of discovery about which aspects of their project idea are already being worked towards, have already been proposed, or already in existence, and which aspects are feasible or infeasible and why, and then a process for communal contemplation of the merits and costs of each proposal, including honest advocacy for contributions to existing projects, mergers of complementary or redundant projects, and prudent council on the process of forking an existing project with the least harm to the principle of reuse of code, and minimizing duplication of efforts.

Maybe you are perfect to be a co-founder of my Charitable Open Source Mentoring Non-Profit Organization, named Dandelion Labs? ( dandelionlabs.org & a dozen subdomains coming soon)
 

OfficerJimLahey

Retired Forum Moderator
Feb 12, 2014
2,716
1,306
Sunnyvale
www.chebucto.ns.ca
I hope that by telling you this, you can practice one of my favorite Design Patterns of the Unix philosophy: "Don't Reinvent the Wheel". You can investigate the state of progress of xonsh to see which of those batch scripts is advantageous

Hmm, as I understand it, since a good deal of what CLIPC does is modify the current environment (typically within that change the working directory), forking out to another environment to do something is well and good in a fork, but I am not aware of the voodoo needed for the changes resulting in that fork coming back. This is a big reason why I work on Bash and fish in parallel. It would be nice to be able to call on other interpreters and have it mean something later on, but this is quite different than calling on a 4DOS function while in DR-DOS.

There is probably a way to shim, but that provides the next problem. I want to be able to provide CLIPC with as few extras not already found in a vanilla install. Even if extras need to be installed, it can be a quick package grab away. According to Debian, xonsh is currently not yet mature enough to be mainline.

Don't get me wrong, I appreciate the alternative perspective. At this time however, since this hobby has slowed to a crawl due to other hobbies (a collection of servers, most of which are not mine; Commodore 64 repair; teasing possibilities with Soekris net4511 & Linksys WRT54GS network devices; odd soldering jobs) and being reasonably satisfied with the effect currently.

At some point I will revisit the old batch files for more ideas; and I will check out what xonsh can do as well. But when it comes to actively leveraging it, seems doubtful, at least for the moderate time frame.

Thanks for the info. :cowboy:
 
  • Like
Reactions: merbst

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Background

    Mostly inspired by DOS and the 1200+ batch files I was gifted in early 2017, CLI Productivity Config is a project to port the concepts over to the Linux shell (whether it be for Bash or fish shell). This project has been developed and tested on Debian 9 (Stretch), but should also work great on Ubuntu 17 (Zesty Zapus, Artful Aardvark).

    If using the Ubuntu Xenial LTS or any derivative (e.g. Linux Mint 18.x), you may find that the columnar expression for the 'dirw' command is not aligned. This is due to a package (BSDMainUtils) being ever-so-slightly too old (9.0.6) for the required feature to appropriately handle escaped characters (9.0.7). Since Ubuntu and the derivatives are currently catching up to a newer version (first LTS being Bionic Beaver), instead of making anyone face an upgrade path, I built from source an updated (9.0.7) package, for both i386 and amd64 architectures for Ubuntu 18.04 and derivatives. Or you can make your own update with 'debuild'.

    Installation

    Getting these tools is relatively easy. The method used below assumes the 'git' package is installed. If not (and don't care to install it either) you can download the package directly.

    Code:
    	git clone https://github.com/joelmaxuel/cli-productivity-config.git
    	cd cli-productivity-config
    	./INSTALL.sh

    For the last command, you can either choose which shell you use (or both) as part of the guided script. Will also prompt for installation of standalone scripts (below), if desired.

    Functions

    Currently, every function available for Bash is available for fish, and vice versa. Arguably the only exception to this is fish has a function called 'sudo!!' where Bash already has the equivalent 'sudo !!'.

    • cdb
    • cdfl
    • cdh
    • clihelp
    • dirw
    • dirlast / dirprev / actlast / actprev
    • editadd
    • mked
    • sudo!!
    • timer

    Scripts

    The theory is that all of these will be built from Bash. They deploy differently (which have it's perks and drawbacks) than functions. Also, the scripts will likely fit a more specific purpose than functions.

    • wakessh

    Support

    I am finding myself very delayed in adding features or finding/fixing issues. Either can be nudged along to my attention by either an issue, posting in this thread (being thorough pays off here) or better yet, a pull request if you have code to back up a particular solution.

    Source

    Found on GitHub: https://github.com/joelmaxuel/cli-productivity-config
    1
    Functions/Scripts in Detail

    cdb

    Performs a search (based on name) below the current working directory to change to any specified matched directory. As this uses a live search, you may not want to use this when then there is a very deep directory structure below, or you will find yourself waiting on the search results.

    Code:
    	joel@cybaryme ~/B/g/android_kernel_asus_msm8916> cdb arm
    	a  1)  ./virt/kvm/arm
    	b  2)  ./arch/arm
    	c  3)  ./Documentation/devicetree/bindings/arm
    	d  4)  ./Documentation/arm
    	e  5)  ./Documentation/zh_CN/arm
    	f  6)  ./sound/arm
    	g  7)  ./tools/perf/arch/arm
    	h  8)  ./drivers/scsi/arm
    	Select directory by letter or number: 2
    	joel@cybaryme ~/B/g/a/a/arm>

    cdfl

    Move anywhere in the filesystem without having to type out or tab through a full path - enter the first letter of every path level instead. '~' and '/' can be used as a prefix (to start with home or root, respectively), or use '.' anywhere in the parameter to go up one level.

    Code:
    	joel@cybaryme /u/l/bin> cdfl ~B.
    	joel@cybaryme ~> cdfl .
    	joel@cybaryme /home> cd
    	joel@cybaryme ~> cdfl Bg
    	a  1)  ./Build/github
    	b  2)  ./Build/genymotion
    	c  3)  ./Build/git:
    	Select directory by letter or number: 1
    	joel@cybaryme ~/B/github> cdfl ..
    	joel@cybaryme ~> cdfl /ulb
    	a  1)  /usr/lib/blt2.5
    	b  2)  /usr/lib/binfmt-support
    	c  3)  /usr/lib/binfmt.d
    	d  4)  /usr/local/bin
    	Select directory by letter or number: 4
    	joel@cybaryme /u/l/bin>

    cdh

    Displays a history of visited directories to allow changing back to one of them.

    Code:
    	joel@cybaryme ~/B/g/a/a/arm> cdh
    	c  3)  ~/Build
    	b  2)  ~
    	a  1)  ~/Build/github/android_kernel_asus_msm8916
    	Select directory by letter or number: 3
    	joel@cybaryme ~/Build> cdh
    	d  4)  ~/Build
    	c  3)  ~
    	b  2)  ~/Build/github/android_kernel_asus_msm8916
    	a  1)  ~/Build/github/android_kernel_asus_msm8916/arch/arm
    	Select directory by letter or number: 3
    	joel@cybaryme ~>

    clihelp

    A helper message about common keyboard shortcuts. Can also be invoked by pressing ^h (CTRL + H)

    Code:
    	joel@cybaryme ~> clihelp
    	
    	Keyboard Shortcuts:
    		CTRL + C – Cancels current command
    		CTRL + S – Repeats the last command with sudo
    		CTRL + L – Provide directory listing in current working directory
    		CTRL + U – Cuts text up until the cursor
    		CTRL + K – Cuts text from the cursor until the end of the line
    		CTRL + W – Cut word behind cursor
    		CTRL + Y – Pastes text
    		CTRL + E – Move cursor to end of line
    		CTRL + A – Move cursor to the beginning of the line
    		ALT + Backspace – Delete previous word
    		CTRL + Left – Move cursor one word to the left
    		CTRL + Right – Move cursor one word to the right
    		Home – Move cursor to beginning of line
    		End – Move cursor to end of the line
    		Tab – Autocomplete current command/argument
    	
    	
    	joel@cybaryme ~>

    dirw

    A compact listing of the current directory with colour. Long names are truncated in the listing. Can also be invoked by pressing ^l (CTRL + L)

    Code:
    	joel@cybaryme ~/B/g/android_kernel_asus_msm8916> dirw
    	android/		AndroidKernel.mk	arch/			block/
    	COPYING			CREDITS			crypto/			Documentation.../
    	drivers/		firmware/		fs/			include/
    	init/			ipc/			Kbuild			Kconfig
    	kernel/			lib/			MAINTAINERS		Makefile*
    	mm/			net/			README			REPORTING-BUGS
    	samples/		scripts/		security/		sound/
    	tools/			usr/			virt/
    	joel@cybaryme ~/B/g/android_kernel_asus_msm8916>

    dirlast / dirprev / actlast / actprev

    These functions either display or act (copy, move or remove) upon files that match a certain age (modified date), whether they are newer than a specific week/day/hour/minute (dirlast/actlast) or older (dirprev/actprev). The searches can also include a (wildcarded) name search as well.

    Code:
    	joel@cybaryme ~/B/g/cli-productivity-config> dirlast D 5 '*.fish' -rl
    	-rw-r--r-- 1 joel joel 2850 Sep  1 17:53 ./fish/functions/dir-core.fish
    	-rw-r--r-- 1 joel joel 50 Sep  1 17:05 ./fish/functions/actlast.fish
    	-rw-r--r-- 1 joel joel 3826 Sep  1 17:53 ./fish/functions/act-core.fish
    	-rw-r--r-- 1 joel joel 50 Sep  1 17:13 ./fish/functions/dirprev.fish
    	-rw-r--r-- 1 joel joel 50 Sep  1 17:15 ./fish/functions/dirlast.fish
    	-rw-r--r-- 1 joel joel 50 Sep  1 17:12 ./fish/functions/actprev.fish
    	-rw-r--r-- 1 joel joel 2634 Sep  4 09:25 ./fish/functions/cdh.fish
    	joel@cybaryme ~/B/g/cli-productivity-config> actprev W 2 cp ..
    	Action: cp
    	The following files will be affected:
    	./README.md
    	./INSTALL-fish.sh*
    	./LICENSE
    	./INSTALL-Bash.sh*
    	Do you wish to continue? [yes|no]: y
    	joel@cybaryme ~/B/g/cli-productivity-config>

    editadd

    Opens a file in your default editor, and then marks it for inclusion in the next git commit ('git status' is also run to verify the addition).

    Code:
    	joel@cybaryme ~/B/g/cli-productivity-config> editadd Bash/.bash_functions
    	M  Bash/.bash_functions
    	joel@cybaryme ~/B/g/cli-productivity-config>

    mked

    Makes and enters a specified directory (or several nested ones when applicable).

    Code:
    	joel@cybaryme ~/B/g/cli-productivity-config> mked examples/Bash
    	joel@cybaryme ~/B/g/c/e/Bash>

    sudo!!

    Repeats the last command, with sudo preceeded. In bash, this already exists as 'sudo !!'. Can also be invoked in either shell by pressing ^s (CTRL + S)

    Code:
    	joel@cybaryme ~> apt-get update
    	Reading package lists... Done
    	W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (1: Operation not permitted)
    	E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
    	E: Unable to lock directory /var/lib/apt/lists/
    	W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
    	W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
    	joel@cybaryme ~> sudo!!
    	[sudo] password for joel: 
    	Ign:1 http://mirror.its.dal.ca/debian jessie InRelease
    	Ign:2 http://mirror.its.dal.ca/debian stretch InRelease                                                   
    	Hit:3 http://mirror.its.dal.ca/debian stretch-updates InRelease                                                
    	Hit:4 http://mirror.its.dal.ca/debian jessie-backports InRelease                                               
    	Hit:5 http://mirror.its.dal.ca/debian jessie Release                                                           
    	Hit:6 http://mirror.its.dal.ca/debian stretch Release                                                          
    	...

    timer

    A cut down 'time' command showing only the "wall clock" time a command has run for.

    Code:
    	joel@cybaryme ~> timer sleep 1
    		Ran for 0:01.00 min:sec
    	joel@cybaryme ~>

    wakessh

    Invokes Wake-On-LAN (WOL) for a PC defined by a profile, then remotes into the system once online.

    Code:
    	joel@cybaryme ~> wakessh android
    	192.168.1.111 not turned on. WOL packet sent at 19:23
    	Waiting a Minute...
    	Trying again.....
    	192.168.1.111 is UP as on 19:24
    	Attempting to SSH android@192.168.1.111...
    	Linux terminatrix 4.14.0-0.bpo.3-amd64 #1 SMP Debian 4.14.13-1~bpo9+1 (2018-01-14) x86_64
    
    	Last login: Sat Mar 10 11:33:38 2018 from 192.168.1.101
    	android@terminatrix:~$
    1
    I hope that by telling you this, you can practice one of my favorite Design Patterns of the Unix philosophy: "Don't Reinvent the Wheel". You can investigate the state of progress of xonsh to see which of those batch scripts is advantageous

    Hmm, as I understand it, since a good deal of what CLIPC does is modify the current environment (typically within that change the working directory), forking out to another environment to do something is well and good in a fork, but I am not aware of the voodoo needed for the changes resulting in that fork coming back. This is a big reason why I work on Bash and fish in parallel. It would be nice to be able to call on other interpreters and have it mean something later on, but this is quite different than calling on a 4DOS function while in DR-DOS.

    There is probably a way to shim, but that provides the next problem. I want to be able to provide CLIPC with as few extras not already found in a vanilla install. Even if extras need to be installed, it can be a quick package grab away. According to Debian, xonsh is currently not yet mature enough to be mainline.

    Don't get me wrong, I appreciate the alternative perspective. At this time however, since this hobby has slowed to a crawl due to other hobbies (a collection of servers, most of which are not mine; Commodore 64 repair; teasing possibilities with Soekris net4511 & Linksys WRT54GS network devices; odd soldering jobs) and being reasonably satisfied with the effect currently.

    At some point I will revisit the old batch files for more ideas; and I will check out what xonsh can do as well. But when it comes to actively leveraging it, seems doubtful, at least for the moderate time frame.

    Thanks for the info. :cowboy: