Skip to content

Instantly share code, notes, and snippets.

@abdulbadii
abdulbadii / gist:affcbb339e7980ee46b0aa9172496718
Created February 1, 2019 12:15
Arch Linux pacman process in batch every item based on user-specified (basic) regex and his optional exclusion
pm(){
pacman -S `pacman -Ss "$1" |sed -E 'N;s/\n//; /$2/Id; s/^\w+\/(\S+).+/\1/'` <<<y
}
filsz(){
x=;f=;d=;p=~+;
for o
{
if [[ $o =~ ^-x ]];then
x=${o//[-x=]/}
elif [[ $o =~ ^-d ]];then
o=${o//[-d=]/}
a=${o%,*};b=${o#*,}
a=${a//[!0-9]/}
@abdulbadii
abdulbadii / l&g.sh
Last active September 28, 2018 20:16
#! /usr/bin/bash
g() {
unset c l s f
for a
{
if [[ $a =~ ^- ]] ;then
test "${a:1:1}" = l &&l=1
else
if test ! $s ;then s=$a