# \#shell-scripting

**URL:** https://forum.codeselfstudy.com/tag/shell-scripting/39.md

[Latest](https://forum.codeselfstudy.com/latest.md) · [Categories](https://forum.codeselfstudy.com/categories.md) · [Tags](https://forum.codeselfstudy.com/tags.md)

---

## [How to Calculate the Time Elapsed in Shell Scripts](https://forum.codeselfstudy.com/t/how-to-calculate-the-time-elapsed-in-shell-scripts/2865)

<div class="topic-metadata">

**Author:** [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Replies:** 0\
**Last updated:** [September 4, 2022, 6:57pm UTC](https://forum.codeselfstudy.com/t/how-to-calculate-the-time-elapsed-in-shell-scripts/2865 "2022-09-04T18:57:07Z")

</div>

I found a useful tip for printing out the time elapsed in shell scripts. #!/usr/bin/env bash SECONDS=0 # The script goes here. sleep 2.57 # Simulate a script that takes 2.57 seconds to run. # Calculate and print the…

---

## [Bash / shell scripting tips thread](https://forum.codeselfstudy.com/t/bash-shell-scripting-tips-thread/212)

<div class="topic-metadata">

**Author:** [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Replies:** 6\
**Last updated:** [February 16, 2022, 7:07pm UTC](https://forum.codeselfstudy.com/t/bash-shell-scripting-tips-thread/212 "2022-02-16T19:07:31Z")

</div>

I’m cross-posting this from the chatroom in order to start a thread about bash tips. The post covers: \`\` vs $() globbing vs regexps Exit Codes if statements, \[ and \[\[ set commands \<() quoting Top three shortcuts sta…

---

## [Desktop Background Switcher for i3wm](https://forum.codeselfstudy.com/t/desktop-background-switcher-for-i3wm/1044)

<div class="topic-metadata">

**Author:** [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Replies:** 0\
**Last updated:** [September 12, 2018, 6:42pm UTC](https://forum.codeselfstudy.com/t/desktop-background-switcher-for-i3wm/1044 "2018-09-12T18:42:20Z")

</div>

I wanted rotating background images on my desktop in i3wm (a great tiling window manager) and had trouble configuring some of the other options, so I wrote this script: #!/bin/zsh # Put this file at \`~/bin/desktop\_back…
