scripts

Various scripts for UNIX-like systems
git clone https://git.tronto.net/scripts
Download | Log | Files | Refs | README

commit 4917899d90e47ff98668e5bb1689f4269a24203d
parent 5509b5f9cc771804876e3d050ea4b0dda9e6fac2
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date:   Thu,  7 Jul 2022 13:27:15 +0200

Merge branch 'master' of https://git.tronto.net/scripts

Diffstat:
MMakefile | 1+
Mconfig-backup | 4++++
Acth | 8++++++++
3 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile @@ -6,6 +6,7 @@ SCRIPTS = addressgrep \ brightness \ clip \ config-backup \ + cth \ dmenu-bookmarks \ dmenu-dwm-sessionmanager \ dmenu-filepicker \ diff --git a/config-backup b/config-backup @@ -7,12 +7,16 @@ folder=$HOME/box/configbackups dotfiles=".bash_profile .bashrc .profile .inputrc .mblaze .nexrc .tmux.conf .xinitrc" config="colors fontconfig git imv mpop msmtp zathura" src="dmenu dwm herbe st" +share="gmni" + +mkdir -p $folder/config $folder/home $folder/share $folder/src # copy for i in $dotfiles; do cp -Rf $HOME/$i $folder/home/; done for i in $config; do cp -Rf $HOME/.config/$i $folder/config/; done for i in $src; do cp -Rf $HOME/.local/src/$i $folder/src/; done +for i in $share; do cp -Rf $HOME/.local/share/$i $folder/share/; done # redact diff --git a/cth b/cth @@ -0,0 +1,8 @@ +#!/bin/sh + +# Print a function or struct defintion from a C file +# see https://sebastiano.tronto.net/blog/2022-06-12-shell-ide-sed + +name=$1 +shift +sed -n "/^$name/,/^}/ p" $@