shellcheckcompatible (99.99%).- Added
array printsnippet.
build.gonow generatesCOMMANDS.mdas well.- Fixed #34 (Argument parsing for switches may result in infinite loop).
- Numerous bug fixed in
fns.
process Name by ID: Get process name by it's ID(s).- Fixed #28 (COMMANDS.md links not working).
- Added animation examples for pendular mode.
- Fixed #29 (thanks to @rwin-novo).
- Fixed #30 and #32 (thanks to @jsbrain).
- Code section removed from
COMMANDS.md.
exit codefor gracefully inform what error happened.array reversesnippet to reverse array elements order added.hide command errorsnippet to suppress command error (stderr),fn animation animatenow supports two mode: circular, pendular.- Binary build tool for major operating systems is available.
iterate directoriessnippet added.archive compress .zipsnippet added.archive decompress .zipsnippet added.system uptime secondssnippet added. Seconds can be formatted byfn time format secondssnippet.remove old/new files/directoriessnippet for removing files (-type f) or directories (-type d) if they are older (-mtime n) than n days or newer (+mtime n) than n days.- Comparison of floating point numbers:
float|double >,float|double >=,float|double <,float|double <=,float|double ==,float|double !=added.
echo arraysnippet added.fn/fx math factorialsnippet added.fn/fx math fibonaccisnippet added.fn/fx math fibonacci seriessnippet added.am I root&am I not rootsnippets added.fn/fx input multichoice: select more than one option.array contains: check if the array contains an element".fn/fx time format secondssnippet to format seconds into days/hours/minutes/seconds.
Now there is a input namespace for getting user input:
input text: formerlyask question.input password: don't show input on screen.fn/fx input choice: formerlyfn/fx options.
- Smooth percentage for
fn progress. echo textandecho variablesnippet added.- assign variable value via
variable assign|variable setsnippet. iterate filessnippet for iterating specific file extensions inside a path.- read/expand variable value via
var|variable read|variable expandsnippet.
- Default command substitution to
$(command). - Default variable expansion to
"${variable}". - Unified TAB ordering.
- Some functions and snippets enhanced.
- Descriptive aliases added to some snippets.
fn/fx urlencode: Encode URL.fn/fx urldecode: Decode URL.
string random: Random string from provided characters with desired length.
loop infinite: Infinite loop.
- New
Shellman ebookrelease. Download free ebook (pdf, epub, mobi) - Fixed issues #20 and #21.
- directory
directory delete nested|directory remove nested: delete directory and all contents.
- Updated
summarysnippet to include exit codes. - Added
looptowhileanduntilprefix. - Added samples:
- Step by step sample script tutorial.
- Fixed issue #19
- Handle events
event ...EXIT: Run commands when script exits.CTRL+C: Run commands when script is interrupted.
- Animation
- Define animation frame.
- Call
animatefunction. Check sample animations. - pacman animation for texts. Check sample animations.
- String
- Concat: Concatenate two strings.
- Renice process and sub processes. PR by @jakiro2017.
archive...- Compress/decompress file/directory to/from
.tar.xz
- Compress/decompress file/directory to/from
- Fixed issue #13. Thanks to @wangyuew.
fn/fx [version | semver] compare- Compare two semver versions. Function compares first argument with the second and returns
>,<or=.
- Compare two semver versions. Function compares first argument with the second and returns
string substring [count | frequency]: Frequency of a substring in a string. You may need character escaping, for example if string is1.2.3and substring is.then substring should be\.when passed to command.
- Fixed issue #10 in math namespace.
- Some enhancements in math namespace.
- Process commands
process ...list: List all processes.id: Get process ID by name.kill: Kill process by name.
cmd renice: Change running process priority.
- Shellman ebook available for download.
math fn/fxsum: Calculate sum of given integers.product: Calculate product of given integers.average: Calculate average of given integers.
- Minor bugs fixed.
letadded for arithmetic operations.
- Escape dollar sign
system...- System information (CPU, Memory, Kernel...)
git...gitcommands.
ftp...list: Get the list of files on the ftp server at specific path.download: Download specified file from ftp server.upload: Upload specified file to ftp server.delete: Delete specified file from ftp server.rename: Rename specified file/directory on ftp server.
http...GET: Send http GET request using curl.POST: Send data with http POST, using curl.POST file: Send file via http POST, using curl.PUT: Send data with http PUT, using curlDELETE: Send http DELETE request using curl.cookie: Send http request with cookies, using curl.header: Send http request with protocol/custom header, using curl.download: Download from url and save to/path/to/file, using curl.
fn/fx progress- Dummy progress bar with custom message
nice- Execute a command with desired privilege
archive...- Compress/decompress file/directory (currently .tar.gz supported. More soon)
crypto...- base64 encode / decode
- Calculate hash of string using md5, sha, sha1, sha224, sha256, sha384 and sha512 algorithms
array...- Array namespace
date...,time...- Date and time commands
file find- Find files and directories by name (wildcard supported)
file search- Search inside all files for a text (i.e. word)
- Argument parsing
- parse command line arguments (flags/switches)
- bug fixed (int less than)
- Documentation improved.
importfunction (fn/fx) added.- Import functions from other shell script files.
optionsfunction (fn/fx) added.- Provide a list of options to user.
math...- math constants (π, e, Ω, ...)
- math operations (with precision).
string substringtypo fixed.
region: A region for specific purpose (functions, variables...)- string manipulation
string length: length of string in characters.string trim: remove leading and trailing white space(s).string trim left: remove leading white space(s).string trim right: remove trailing white space(s).string trim all: remove all white space(s).string replace: find all occurrences of a substrings and replace them.string reverse: reverse string characters.string toLower: convert string to lowercase.string toUpper: convert string to uppercase.string substring: part of the string from offset with [length] characters.string contains: check whether string contains substring.string indexOf: first index of substring in string.
assign array: assign elements to an array.ip ...ips: array of local IPs.ip info: public ip information (country, city...).ip public: public ip address.
random number: generate random integer x such as min < x < max.service manage: manage service operations viasystemctl.timeout: run command within a time frame. Cancel command if not finished within x seconds.fn/fxscan: scan host's port range and find open ports (tcp/udp).
- stopwatch
fn.../fx...whole function and usage insertion.fn banner simple: insert function to print a banner.fn banner color: insert function to print a color banner.
- Check last command success/failure via
cmd... - Directory operations via
directory...
- Fixed vscode marketplace header color contrast
- Minor bugs fixed
- Write colorful text
- Write formatted text (bold, italic, dim, reverse)
- Snippet documentation added
Initial release