#bash

81 posts · Last used 15d

How do you remove any trailing characters from a variable in bash? I am digitizing my dad’s video and audio tapes, for which I - after painstakingly scouring the documentation of ffmpeg, as one should - finally have found the encoding options that I’m happy with. :D But instead of retyping the PhD dissertation that are the ffmpeg commands that I use a bazillion times, I have simply started to do command substitution with for instance $(cat command_ffmpeg_COPYCODEC) or $(cat command_ffmpeg_H264) and the likes. This, however, still requires me to vim the correct filenames into these concatenated commands every time I work on a new project, so I thought, “Why not just set a variable, like I use to do with visudo as in EDITOR=/bin/vim visudo So, wanting to do a little ffmpeg magic to delay the audio stream of a file, I tried FILENAME='birthday_0' $(cat command_ffmpeg_SYNCAUD) but bash said, “no, who do you think you are?” After doing a wc on FILENAME, I noticed that there is an invisible trailing something after the filename - possibly some whitespace char - since it thinks that I mean to use an option “-synced.mkv”. How would you go about writing the now bash script (it simply wouldn’t expand the variable through command substitution…) so that the trailing whatever is deleted, if that is indeed the case? I have tried slapping " “, ' ‘, ( ), { } in all conceivable configurations, but I’m simply to inexperienced. xD Please advise! 🛠️
27
19
0
0
Meteorology Current weather in Leonsberg SR SA with magnifico power of wttr.in & le passion grace beauty & colours of lolcat(6) 🏳️‍🌈 wttr curl(1) & {ba{c{k{z{fi}}}}}sh Background photograph is a nice Clouds in FL shades scene meticulously and passionately composed with CIRC_POL 81A FL and UV filters stacked using a Nikon Analog SLR lens combo in my Negative film photography phaselog metalloid@krishna:~/gate/docs $ curl -v wttr.in/leonsberg_suriname|lolcat % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Host wttr.in:80 was resolved. IPv6: (none)IPv4: 5.9.243.187 Trying 5.9.243.187:80...Connected to wttr.in (5.9.243.187) port 80using HTTP/1.x> GET /leonsberg_suriname HTTP/1.1> Host: wttr.in> User-Agent: curl/8.14.1> Accept: /> Request completely sent off< HTTP/1.1 200 OK< Access-Control-Allow-Origin: *< Cache-Control: public, max-age=600< Content-Type: text/plain; charset=utf-8< Date: Fri, 04 Sep 2026 19:27:35 GMT< Transfer-Encoding: chunked< { [8791 bytes data]100 8778 0 8778 0 0 8929 0 --:--:-- --:--:-- --:--:-- 8929 Connection #0 to host wttr.in left intact Weather report: leonsberg_suriname \ / Sunny .-. +34(37) °C ― ( ) ― ↓ 9 km/h `-’ 10 km / \ 0.0 mm Location: Leonsberg, Blauwgrond, Suriname [5.8692506,-55.1026346] Note: Remember to repeat the request with an interval of 8 then 24 secs when the server sends and empty response to curl, watch the LOG! API https://wttr.in https://en.wikipedia.org/wiki/Bash_(Unix_shell) https://gnu.org https://directory.fsf.org/wiki/Bashhttps://curl.se/ https://github.com/busyloop/lolcat Z #Weather #wttr #lolcat #curl #bash #csk #ksh #zsh #sh #fish #meteorology #environment #Physics #Chemistry #Mathematics #Lineair #algebra #technology #OpenSource #programming #POSIX
9
0
14
0
#Linux #Bash xdg-open öffnet eine Datei oder URL in der vom Benutzer bevorzugten Anwendung. Wird eine URL angegeben, so wird diese im bevorzugten Webbrowser des Benutzers geöffnet. Wird eine Datei angegeben, so wird diese in der für den jeweiligen Dateityp bevorzugten Anwendung geöffnet. xdg-open unterstützt URLs der Schemata file, ftp, http und https. Beispiel: xdg-open 'https://www.untergang.de/' oder xdg-open '~/Bilder/blume.jpg'
1
0
0
0
Este script sirve para descargar todos los enlaces youtube de una comunidad de Lemmy (en el ejemplo Blahaj.zone), los ubica en dos archivos: uno con descripciones e información del enlace, otro con los enlaces solos para listas de reproducción o descargas. Hecho por IA. Socializado por humanos. https://framadrive.org/s/dE3drP7RmQLrX48 #Software #Bash #Script #Lemmy #Extract #Youtube #Link #Enlaces #Ska #Music #GPL
0
1
2
0

Meteorology Kwamalasemutu Current weather in Kwamalasemutu SR SA with infinite power of wttr.in & the grace and dance of lolcat(6) 🏳️‍🌈 wttr curl(1) & {ba{c{k{z{fi}}}}}sh Background photograph is my favourite Sluis in Sepia scenes composed with CIRC_POL 81A FL and UV filters chronologically stacked using a Nikon SLR lens combo with the DSLR in Sepia moduslog $ curl --verbose wttr.in/kwamalasemutu|lolcat % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:-- 0* Trying 5.9.243.187:80... 0 0 0 0 0 0 0 0 --:--:-- 0:00:57 --:--:-- 0^C metalloid@krasiwati:~/gate/audio/raw/flac/αβeats∞ $ curl --verbose wttr.in/kwamalasemutu|lolcat % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 5.9.243.187:80...

  • Connected to wttr.in (5.9.243.187) port 80 (#0)

GET /kwamalasemutu HTTP/1.1 Host: wttr.in User-Agent: curl/7.88.1 Accept: /

< HTTP/1.1 200 OK < Access-Control-Allow-Origin: * < Cache-Control: public, max-age=600 < Content-Type: text/plain; charset=utf-8 < Date: Sun, 26 Jul 2026 14:28:49 GMT < Transfer-Encoding: chunked < { [3903 bytes data] 100 8675 0 8675 0 0 9044 0 --:--:-- --:--:-- --:--:-- 9045

  • Connection #0 to host wttr.in left intact Weather report: kwamalasemutu

    \   /     Sunny
     .-.      +30(31) °C
    

    ― ( ) ― ↙ 8 km/h `-’ 10 km / \ 0.0 mm

Location: Kwamalasemutu, Coeroeni, Sipaliwini, Suriname [2.3554503,-56.787836] Note: Remember to repeat the request with an interval of 8 then 30 secs when the server sends and empty response to curl

Watch the LOG! API https://wttr.in

https://en.wikipedia.org/wiki/Bash_(Unix_shell)

https://gnu.org

https://directory.fsf.org/wiki/Bash

https://curl.se/

https://github.com/busyloop/lolcat

Z

#Weather #wttr #lolcat #curl #bash #csk #ksh #zsh #sh #fish #meteorology #environment #Physics #Chemistry #Mathematics #Lineair #algebra #technology #OpenSource #programming #POSIX

5
0
11
0
Can someone explain me why when you try to store the output of a printf into a variable in the shell it just doesn't store the newline at the end? It will store any other newlines but if the newline is at the end it will just not store it in the variable. #shell #bash #debian
0
0
0
0
#Linux #Bash #toot Mastodon . Alle Follower blocken, die noch nie was getrötet haben. Und eine 2. Chance geben. Es gibt Zombies: Error: Account not found Error: Remote SSL certificate could not be verified Error: Remote data could not be fetched Aber die tun auch nichts mehr. Es ist wieder mal ein Einzeiler für Bash : https://gist.github.com/dewomser/e2a175e4c10de51a3fa5be08dfbbcc47
0
0
2
0