Skip to content

Instantly share code, notes, and snippets.

View td-shi's full-sized avatar

TD氏 td-shi

  • Near Port
View GitHub Profile
@td-shi
td-shi / toXPATH.sh
Last active February 24, 2020 13:11
Converting XML to (like) XPATH. [List Repository](https://github.com/td-shi/ShellScriptsOnGist)
#!/bin/bash --posix
# -*- coding:utf-8 -*-
# === Coding shell scripting Memo ==============================================
# ${<name>#<pattern>} :: matching delete with shortest by forword.
# ${<name>##<pattern>} :: matching delete with longest by forword.
# ${<name>%<pattern>} :: matching delete with shortest by backword.
# ${<name>%%<pattern>} :: mathing delete with longest by backword.
# ${<name>/<before>/<after>} :: replace only first matching.
# ${<name>//<before>/<after>} :: replace all matching.
#!/bin/bash --posix
# -*- coding:utf-8 -*-
# === Coding shell scripting Memo ==============================================
# ${<name>#<pattern>} :: matching delete with shortest by forword.
# ${<name>##<pattern>} :: matching delete with longest by forword.
# ${<name>%<pattern>} :: matching delete with shortest by backword.
# ${<name>%%<pattern>} :: mathing delete with longest by backword.
# ${<name>/<before>/<after>} :: replace only first matching.
# ${<name>//<before>/<after>} :: replace all matching.
@td-shi
td-shi / c-template_linux_cli_application.c
Created May 31, 2020 04:56
Template of CLI application for linux shell
//(1)=========================================================<< File Header >>=
/**
* @file c-template_linux_cli_application.c
* @brief <Application meaning> Ver 0.01
* @author TD
* @date 2020-05-31
*
* <pre> 2020 TD LICENSED CC0 </pre>
******************************************************************************/
//(2)======================================================<< System Include >>=
@td-shi
td-shi / POSIX_commands.md
Last active June 24, 2025 13:13
About POSIX commands list

POSIX commands

You should refer the original page. The all copyrights of these documents belong to them.

Using frequent

filter

  • grep :: search a file for a pattern
@td-shi
td-shi / damm.sh
Last active March 15, 2021 13:27
Generate checkdigit by damm algorithm.
#!/bin/sh
# -*- coding:utf-8 posix -*-
# === Coding shell scripting Memo ==============================================
# ${<name>#<pattern>} :: matching delete with shortest by forword.
# ${<name>##<pattern>} :: matching delete with longest by forword.
# ${<name>%<pattern>} :: matching delete with shortest by backword.
# ${<name>%%<pattern>} :: mathing delete with longest by backword.
# ${<name>/<before>/<after>} :: replace only first matching.
# ${<name>//<before>/<after>} :: replace all matching.
@td-shi
td-shi / base64.sh
Last active March 15, 2021 13:55
Encode and decode to or from base 64.
#!/bin/sh
# -*- coding:utf-8 posix -*-
# === Coding shell scripting Memo ==============================================
# ${<name>#<pattern>} :: matching delete with shortest by forword.
# ${<name>##<pattern>} :: matching delete with longest by forword.
# ${<name>%<pattern>} :: matching delete with shortest by backword.
# ${<name>%%<pattern>} :: mathing delete with longest by backword.
# ${<name>/<before>/<after>} :: replace only first matching.
# ${<name>//<before>/<after>} :: replace all matching.
@td-shi
td-shi / plantuml-config-head.pu
Created July 27, 2021 12:35
The configuration plantuml on file head
@startuml
skinparam shadowing false
skinparam monochrome true
skinparam defaultFontName Helvetica
skinparam BackgroundColor transparent
skinparam ActivityBackgroundColor #FFFFFF
skinparam ActivityDiamondBackgroundColor #FFFFFF
skinparam ActorBackgroundColor #FFFFFF
skinparam AgentBackgroundColor #FFFFFF
@td-shi
td-shi / lid.sh
Last active July 31, 2021 00:43
The lid.sh generate 9-character random and based date string.
#!/bin/sh
# -*- coding:utf-8 posix -*-
# === Coding shell scripting Memo ==============================================
# ${<name>#<pattern>} :: matching delete with shortest by forword.
# ${<name>##<pattern>} :: matching delete with longest by forword.
# ${<name>%<pattern>} :: matching delete with shortest by backword.
# ${<name>%%<pattern>} :: mathing delete with longest by backword.
# ${<name>/<before>/<after>} :: replace only first matching.
# ${<name>//<before>/<after>} :: replace all matching.
@td-shi
td-shi / rep2ascii.sh
Created July 31, 2021 13:49
Replacing to a ASCII character.
#!/bin/bash --posix
# -*- coding:utf-8 -*-
# === Coding shell scripting Memo ==============================================
# ${<name>#<pattern>} :: matching delete with shortest by forword.
# ${<name>##<pattern>} :: matching delete with longest by forword.
# ${<name>%<pattern>} :: matching delete with shortest by backword.
# ${<name>%%<pattern>} :: mathing delete with longest by backword.
# ${<name>/<before>/<after>} :: replace only first matching.
# ${<name>//<before>/<after>} :: replace all matching.
@td-shi
td-shi / b64post.sh
Last active August 12, 2021 07:25
b64post.sh generate from base64 to character symbols are a post bar '0' - '7' , stop, start and end(for adjast view).
#!/bin/sh
# -*- coding:utf-8 posix -*-
# === Coding shell scripting Memo ==============================================
# ${<name>#<pattern>} :: matching delete with shortest by forword.
# ${<name>##<pattern>} :: matching delete with longest by forword.
# ${<name>%<pattern>} :: matching delete with shortest by backword.
# ${<name>%%<pattern>} :: mathing delete with longest by backword.
# ${<name>/<before>/<after>} :: replace only first matching.
# ${<name>//<before>/<after>} :: replace all matching.