- some improvements.
- fixed #52
- fixed #53
- some improvements to become more standard.
Fixes issue #48
- Fixed #47 (thanks to Haltarys)
shellcheck
compatible (99.99%).- Added
array print
snippet.
build.go
now generatesCOMMANDS.md
as well.- Fixed #34 (Argument parsing for switches may result in infinite loop).
- Numerous bug fixed in
fn
s.
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 code
for gracefully inform what error happened.array reverse
snippet to reverse array elements order added.hide command error
snippet to suppress command error (stderr),fn animation animate
now supports two mode: circular, pendular.- Binary build tool for major operating systems is available.
iterate directories
snippet added.archive compress .zip
snippet added.archive decompress .zip
snippet added.system uptime seconds
snippet added. Seconds can be formatted byfn time format seconds
snippet.remove old/new files/directories
snippet 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 array
snippet added.fn/fx math factorial
snippet added.fn/fx math fibonacci
snippet added.fn/fx math fibonacci series
snippet added.am I root
&am I not root
snippets added.fn/fx input multichoice
: select more than one option.array contains
: check if the array contains an element".fn/fx time format seconds
snippet 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 text
andecho variable
snippet added.- assign variable value via
variable assign
|variable set
snippet. iterate files
snippet for iterating specific file extensions inside a path.- read/expand variable value via
var
|variable read
|variable expand
snippet.
- 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 ebook
release. Download free ebook (pdf, epub, mobi) - Fixed issues #20 and #21.
- directory
directory delete nested
|directory remove nested
: delete directory and all contents.
- Updated
summary
snippet to include exit codes. - Added
loop
towhile
anduntil
prefix. - 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
animate
function. 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.3
and 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/fx
sum
: Calculate sum of given integers.product
: Calculate product of given integers.average
: Calculate average of given integers.
- Minor bugs fixed.
let
added for arithmetic operations.
- Escape dollar sign
system...
- System information (CPU, Memory, Kernel...)
git...
git
commands.
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.
import
function (fn/fx) added.- Import functions from other shell script files.
options
function (fn/fx) added.- Provide a list of options to user.
math...
- math constants (π, e, Ω, ...)
- math operations (with precision).
string substring
typo 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/fx
scan
: 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