#bash

83 posts · Last used 3m

Any way to make commands in bash scripts in the Linux terminal accept characters with accents such as 'ú'? #!/bin/bash # name of the script is SCAN.bash scanimage -d [device] --format=png -p -o $1 I have tried ' ‘, " " and to escape it with \ ./SCAN 'július.png' ./SCAN "július.png" ./SCAN j\úlius.png But it throws argument without option. It works fine if I type it out instead of scripting. The target language is Hungarian and I have generated the necessary locale.
0
0
0
0
handling of PATH i’ve been configuring my system and when i checked my PATH there were duplicates. so i started trying to deduplicate it for tidiness, so far i’ve been messing around with 90-user.conf and .profile files. i also did some other stuff in my nushell configs but that’s because of how nushell works, so i don’t have much doubts about that. i’ll try to be as clear, concise as possible, but since i’ve started doing this stuff very recently i might not exactly know where to aim my question. so i guess i have doubts regarding if this is a correct way to handle PATH declaration and deduplication. from what i understand, i need to define it in various places because having a correct path depends largely on where you’re inheriting it. so maybe your GUI session has a proper PATH, but if you log in through a TTY or similar you might have a different one. also different files also add their own stuff. so should i only care about these 2 files to have a proper file or is there something else i should keep in mind? is the reasoning correct? if you need some other file just let me know and i’ll share it if it’s useful. below is system information in case it’s relevant. ❯ fastfetch ╭─ システム [ghost-user] │ │ os Fedora Linux 43 │ kernel 7.2.13-100.fc43.x86_64 │ age 345 days │ uptime 8 hours, 10 mins │ shell nushell 0.99.1 │ de GNOME 49.10 │ wm Mutter (Wayland) │ cpu AMD Ryzen 5 5600G 4.46 GHz │ memory 5.23 GiB / 7.05 GiB (74%) │ │ 過去を殺せ ╰────────────────────────────────────────── #90-user.conf EDITOR=hx BROWSER=firefox XDG_DATA_HOME=$HOME/.local/share XDG_CONFIG_HOME=$HOME/.config XDG_CACHE_HOME=$HOME/.cache PATH=$HOME/.local/bin:$HOME/.cargo/bin:$HOME/.opencode/bin:/usr/local/go/bin${PATH:+:$PATH} PKG_CONFIG_PATH=/usr/lib64/pkgconfig #.profile export _DOTFILES_PROFILE_SOURCED=1 case ":$PATH:" in *":$HOME/.opencode/bin:"*) ;; *) PATH="$HOME/.opencode/bin:$PATH" ;; esac [ -f "$HOME/.cargo/env" ] && . "$HOME/.cargo/env" case ":$PATH:" in *":/usr/local/go/bin:"*) ;; *) PATH="$PATH:/usr/local/go/bin" ;; esac if [ -n "$PATH" ]; then pinned="" IFS_OLD=$IFS IFS=: for _d in $PATH; do [ -z "$_d" ] && continue case ":$pinned:" in *":$_d:"*) continue ;; esac [ "$_d" = "$HOME/.local/bin" ] && continue pinned="${pinned}${pinned:+:}${_d}" done IFS=$IFS_OLD unset _d export PATH="$HOME/.local/bin:$pinned" fi verification: #bash ❯ echo "$PATH" | tr ':' '\n' /home/ghost_user/.local/bin /usr/lib64/ccache /home/ghost_user/.cargo/bin /home/ghost_user/.opencode/bin /usr/local/go/bin /usr/local/bin /usr/bin #nushell ❯ $env.PATH ╭───┬────────────────────────────────╮ │ 0 │ /home/ghost_user/.local/bin │ │ 1 │ /usr/lib64/ccache │ │ 2 │ /home/ghost_user/.cargo/bin │ │ 3 │ /home/ghost_user/.opencode/bin │ │ 4 │ /usr/local/go/bin │ │ 5 │ /usr/local/bin │ │ 6 │ /usr/bin │ ╰───┴────────────────────────────────╯
0
1
0
0
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
1
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
2
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