mastouille.fr est l'un des nombreux serveurs Mastodon indépendants que vous pouvez utiliser pour participer au fédiverse.
Mastouille est une instance Mastodon durable, ouverte, et hébergée en France.

Administré par :

Statistiques du serveur :

582
comptes actifs

#unixshell

0 message0 participant0 message aujourd’hui
R.L. Dane :Debian: :OpenBSD: 🍵 :MiraLovesYou:<p>In the helpful shell functions department:</p><p>(Requires <code>bc</code> to be installed)</p><pre><code>load() { local load=$(uptime |sed -E "s/^.*load averages?: //; s/,.*$//") local uname="$(uname)" local cpus if [[ $1 == -q ]]; then echo "$load" elif [[ $1 == -i ]]; then echo "$load + 0.5" |bc -l |cut -f1 -d. else case "$uname" in Linux) cpus=$(grep -c ^processor /proc/cpuinfo);; *BSD) cpus=$(sysctl hw.ncpu |tr -dc "0-9\n");; *) warn "load(): assuming 1 cpu, don't know how to get the number in \"$uname\"" cpus=1;; esac local loadPerCPU=$(echo "scale=3; $load / $cpus" |bc -l |sed 's/^\./0./') echo "$load ($loadPerCPU per processor ($cpus))" fi } </code></pre><p><a href="https://polymaths.social/tags/shellscripting" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ShellScripting</span></a> <a href="https://polymaths.social/tags/unixshell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>UnixShell</span></a> <a href="https://polymaths.social/tags/shellscripts" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ShellScripts</span></a> <a href="https://polymaths.social/tags/bash" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>bash</span></a> <a href="https://polymaths.social/tags/ksh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ksh</span></a> <a href="https://polymaths.social/tags/sh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>sh</span></a></p>
R.L. Dane :Debian: :OpenBSD: 🍵 :MiraLovesYou:<p><a href="https://polymaths.social/tags/poll" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Poll</span></a>: Curious about people's attitudes towards shell scripting.</p><p>Two part question:</p><ol><li>Are you a DEVeloper (or working in a development-heavy role), OTHER-IT worker (such as a sysadmin, architect, anything in a non-development-heavy role), or NON-IT (accountant, doctor, whatever)</li><li>Do you HATE shell scripting, are you INDIFferent towards (or ignorant of) shell scripting, or do you LOVE it?</li></ol><p><a href="https://polymaths.social/tags/unix" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Unix</span></a> <a href="https://polymaths.social/tags/unixshell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>UnixShell</span></a> <a href="https://polymaths.social/tags/shellscript" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ShellScript</span></a> <a href="https://polymaths.social/tags/shellscripting" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ShellScripting</span></a> <a href="https://polymaths.social/tags/posix" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>POSIX</span></a> <a href="https://polymaths.social/tags/posixshell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PosixShell</span></a> <a href="https://polymaths.social/tags/sh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>sh</span></a> <a href="https://polymaths.social/tags/bash" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>bash</span></a> <a href="https://polymaths.social/tags/zsh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>zsh</span></a> <a href="https://polymaths.social/tags/csh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>csh</span></a> <a href="https://polymaths.social/tags/tcsh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>tcsh</span></a> <a href="https://polymaths.social/tags/ksh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ksh</span></a> <a href="https://polymaths.social/tags/pdksh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>pdksh</span></a> <a href="https://polymaths.social/tags/oksh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>oksh</span></a> <a href="https://polymaths.social/tags/mksh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>mksh</span></a></p>
Lars Wirzenius<p>I experimented with not having persistent shell history, after <span class="h-card" translate="no"><a href="https://hachyderm.io/@simontatham" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>simontatham</span></a></span> blogged about it.</p><p>Good:<br>- higher threshold for writing long complicated commands<br>- lower threshold for writing shell scripts instead</p><p>Bad:<br>- writing shell scripts</p><p>I've since started experimenting with the Fish shell, and it brings a whole different level to the shell history game. So far I like it.</p><p><a href="https://toot.liw.fi/tags/UnixShell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>UnixShell</span></a> <a href="https://toot.liw.fi/tags/shell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>shell</span></a> <a href="https://toot.liw.fi/tags/bash" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>bash</span></a> <a href="https://toot.liw.fi/tags/fishShell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>fishShell</span></a> <a href="https://toot.liw.fi/tags/fish" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>fish</span></a></p>
R.L. Dane :Debian: :OpenBSD: 🍵 :MiraLovesYou:<p>I've probably tooted about this before, but I don't know why this isn't standard.</p><p>It's just so obvious, at least to me. ;)</p><pre><code>~ $ type mcd mcd is a function mcd () { [[ -n $1 ]] &amp;&amp; mkdir "$1" &amp;&amp; cd "$1" } </code></pre><p><a href="https://polymaths.social/tags/shell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>shell</span></a> <a href="https://polymaths.social/tags/unixshell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>UnixShell</span></a> <a href="https://polymaths.social/tags/shellscripting" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ShellScripting</span></a> <a href="https://polymaths.social/tags/sh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>sh</span></a> <a href="https://polymaths.social/tags/bash" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>bash</span></a> <a href="https://polymaths.social/tags/ksh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ksh</span></a> <a href="https://polymaths.social/tags/mksh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>mksh</span></a></p>
R.L. Dane :Debian: :OpenBSD: 🍵 :MiraLovesYou:<p>Should've made this a long time ago:</p><pre><code>function ciglob { #case-insensitive glob generator echo "$*" |while read -N1 c; do case "$c" in [a-zA-Z]) echo -n "[${c^^}${c,,}]";; *) echo -n "$c" esac done } </code></pre><pre><code>~ $ ciglob "Hello, world!" [Hh][Ee][Ll][Ll][Oo], [Ww][Oo][Rr][Ll][Dd]! ~ $ ls -ld $(ciglob documents) drwxr-xr-x 52 ~~~ ~~~ 20,480 Apr 10 11:45 Documents </code></pre><p>(Not the most useful example, but I did have a use case in mind when I wrote it ;)</p><p>P.S. (This is a valid way to close a parenthesis. Fight me ;)</p><p><a href="https://polymaths.social/tags/bash" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>bash</span></a> <a href="https://polymaths.social/tags/ksh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ksh</span></a> <a href="https://polymaths.social/tags/sh" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>sh</span></a> <a href="https://polymaths.social/tags/shell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>shell</span></a> <a href="https://polymaths.social/tags/unixshell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>UnixShell</span></a> <a href="https://polymaths.social/tags/posix" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>POSIX</span></a> <a href="https://polymaths.social/tags/posixshell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PosixShell</span></a> <a href="https://polymaths.social/tags/shellscripting" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ShellScripting</span></a></p>
ZB MED<p>🛠️ Curious how coding can support your research?<br>Join our Software Carpentry Workshop for absolute beginners – no experience needed, just curiosity and motivation!</p><p>📅 May 12–13, 2025, 09:00–16:00<br>📍 ZB MED, Cologne<br>👩‍💻 Hands-on sessions on:<br><a href="https://mastodon.social/tags/UnixShell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>UnixShell</span></a><br><a href="https://mastodon.social/tags/Git" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Git</span></a> for version control<br><a href="https://mastodon.social/tags/Python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python</span></a> programming</p><p>👩‍🏫 With <span class="h-card" translate="no"><a href="https://mastodon.social/@RabeaMue" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>RabeaMue</span></a></span>, Silvia Di Giorgio &amp; Justine Vandendorpe<br>🔗 Register: <a href="https://zbmed.github.io/2025-05-12-Software_Carpentry_ZB_MED/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">zbmed.github.io/2025-05-12-Sof</span><span class="invisible">tware_Carpentry_ZB_MED/</span></a></p><p><a href="https://mastodon.social/tags/SoftwareCarpentry" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>SoftwareCarpentry</span></a> <a href="https://mastodon.social/tags/OpenScience" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>OpenScience</span></a> <a href="https://mastodon.social/tags/ResearchTools" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ResearchTools</span></a> <a href="https://mastodon.social/tags/CodingForResearchers" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CodingForResearchers</span></a></p>
Blobster<p><span class="h-card" translate="no"><a href="https://framapiaf.org/@jeeynet" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>jeeynet</span></a></span> Salut, merci pour l'idée, je ne savais pas que c'était possible&nbsp;! Concernant le script proposé, ce test est bizarre &nbsp;:</p><pre><code>if [ "${1}" ]<br></code></pre><p>Si <code>"${1}"</code> venait à coïncider avec un opérateur de <code>test(1)</code> , vous auriez des surprises. Je suggère ceci à la place&nbsp;:</p><pre><code>if [[ $# -gt 0 ]]<br></code></pre><p>ou bien</p><pre><code>if [[ -n "$1" ]]<br></code></pre><p>Notes&nbsp;:</p><ul><li><p>on peut se permettre <code>[[ … ]]</code> car le script utilise Bash;</p></li><li><p>vous pouvez enlever les <code>"</code> autour de <code>$1</code> dans cet exemple mais attention, c'est un cas bien particulier dû au fait que <code>[[ … ]]</code> ne fait pas de “word splitting” sur l'expression fournie).</p></li></ul><p><a href="https://infosec.exchange/tags/Bash" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Bash</span></a> <a href="https://infosec.exchange/tags/shell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>shell</span></a> <a href="https://infosec.exchange/tags/UnixShell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>UnixShell</span></a></p>
Sampo Rapeli<p>My master's thesis "Understanding the role of Unix shell in software development and developer experience" is now available online!</p><p>Explore how developers use the shell, their emotions towards it, and its impact on developer experience.</p><p><a href="https://hachyderm.io/tags/unixshell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>unixshell</span></a> <a href="https://hachyderm.io/tags/developerexperience" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>developerexperience</span></a> <a href="https://hachyderm.io/tags/softwaredevelopment" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>softwaredevelopment</span></a></p><p><a href="https://urn.fi/URN:NBN:fi:aalto-202408255833" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">urn.fi/URN:NBN:fi:aalto-202408</span><span class="invisible">255833</span></a></p>
JdeBP<p><span class="h-card"><a href="https://mastodon.social/@Migueldeicaza" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>Migueldeicaza</span></a></span> <span class="h-card"><a href="https://infosec.exchange/@mholt" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>mholt</span></a></span> <span class="h-card"><a href="https://mastodon.social/@film_girl" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>film_girl</span></a></span> </p><p>I should have kept track of whoever it was commenting the other week about how many machine instructions and conversions to and from machine-readable form it takes to increment a variable by 1.</p><p>_math() {<br> _m_opts="$@"<br> printf "%s" "$(($_m_opts))"<br>}</p><p>...</p><p>_request_retry_times=$(_math "$_request_retry_times" + 1)</p><p><a href="https://tty0.social/tags/UnixShell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>UnixShell</span></a> <a href="https://tty0.social/tags/ACME" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ACME</span></a></p>