#bash

d1cor@diasp.eu

#BASH TIP

Si en la variable de entorno HISTCONTROL tenés algo como "ignoreboth", entonces podés dejar un espacio en blanco antes de la ejecución de un comando para no dejar rastro en el history.

Si no:

echo "HISTCONTROL=ignoreboth" >> ~/.bashrc

Hacelo y sentite un Mr.Robot :P

postnotejazz@diasp.org

jpog-XP is a tool I wrote for reading and writing metadata in jpg and ogg files; specifically XPComment and XPTitle for jpg as well as title and comment for ogg. It also replaces newline characters with "" since I need the metadata to be web friendly.

The art and music sections of my website ( http://www.jesnjem.art ) are designed to display title and descriptions for songs and images based on the metadata they contain. When I was running Windows it was no problem to edit the metadata using the properties menu. Now that I've migrated to Linux I found that the XPComment and XPTitle sections I was modifying are somewhat proprietary to Microsoft. Boo! This means there's no menu to edit these sections and most command line tools fail to write to those sections. After some research I was able to write this little app that allows me to modify those fields once again.

You can get a copy of the app here https://bit.ly/jpog-XP
and if you're interested in seeing the source I've made it available to my Patreon supporters
here https://bit.ly/pnj_

#linux #bash #code #programming #metadata

danie10@squeet.me

Bash Scripting – Functions Explained With Examples

In Bash shell scripting, functions are ways to group the set of instructions together to get a specific outcome. You can think of functions as a mini script. Functions are also called procedures and methods in some programming languages. Functions are a great way to achieve modularity and reusability. And especially so if you define your functions in one script file, and import those into other script files. This is similar to import statements in python, include statements in C, etc.

See Bash Scripting - Functions Explained With Examples - OSTechNix

#technology #linux #bash #functions #scripting

Image/photo

This guide explains what are Bash functions and how to define and call a function in Bash scripts with examples.


https://gadgeteer.co.za/bash-scripting-functions-explained-examples

jojan@wk3.org

I am going to teach some colleagues to use shell. Starting with ls,cd, mkdir et al to navigate, and creating files and directories. Then some more advanced tools like grep and find, as well as a bit of sed and awk. Ending with advanced shell script. I will teach using bash, as it is default in many systems today, but thought I would mention some others and how they differ.

The idea now is to have five sessions of two hours each. I will try to make a proper outline this weekend. This is about what I have today

  • Session 1: Navigating in Shell, Unix file system, creating files, pipes (|, < and > and perhaps 2>&1 et al)
  • Session 2: grep, find, sed, tr
  • Session 3: aliases and .bashrc
  • Session 4: scripts
  • Session 5: more scripts?

Do you have any suggestion of what I should mention? Do you think this outline looks all right?

#bash #sed #awk #gnu #linux #unix #terminal

hackbyte@pluspora.com

Because i just had a reason to re-visit and uhm, finally publish a weirdo but helpful #bash #oneliner, which easily predates newer #linux tools like #psgrep and so on.

Let me share it here, just for everyone interested.

https://pastebin.com/k23QTCiA

psg () 
{ 
    # Based on something i learned from A. Spohr way back in the mid 1990ies.
    # Recreated and refined to a useful oneliner in IRCNet in #linux.de in
    # the first decade of 2k. ;)
    /bin/ps xau | /bin/grep COMMAND\\\|$1 | /bin/grep -v grep
}

It's idea actually predates the invention of the modern psgrep command, but in retrospect really nicely complements it imho. ;)

#shell #psg #opensource

canoodle@nerdpol.ch

GNU Linux - what to do - if there is no vi and no less - nano can do both

in theory yes, nano can replace vi and less, but in reality, it faults on large amount of data-files-streams

<span style="color: #00ffff;">hostnamectl</span>; # as seen on
   Static hostname: giada
  Operating System: Debian GNU/Linux 10 (buster)
            Kernel: Linux 4.19.0-17-amd64
      Architecture: x86-64

# example<span style="color: #00ffff;">
wget https://thesquareplanet.com/feed.xml

</span>#  328K? wohoo very "large" file<span style="color: #00ffff;">
du -hs feed.xml 
</span>328K feed.xml<span style="color: #00ffff;">

cat feed.xml | nano -
</span>

#linux #gnu #gnulinux #opensource #administration #sysops #nano #vi #less #bash

Originally posted at: https://dwaves.de/2021/08/19/gnu-linux-what-to-do-if-there-is-no-vi-and-no-less-nano-can-do-both/