ohmybash / oh-my-bash

A delightful community-driven framework for managing your bash configuration, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
https://ohmybash.github.io
MIT License
5.53k stars 624 forks source link

sudo: _omb_util_alias_init_mv: command not found #544

Closed stueja closed 3 months ago

stueja commented 3 months ago

Trying to mv files like

sudo mv *ttf /usr/share/fonts/TTF

results in the above error even after upgrade:

09:21:43 jan@two-arch ttf-gowun-batang ±|master ✗|→ upgrade_oh_my_bash 
Updating Oh My Bash
remote: Enumerating objects: 96, done.
remote: Counting objects: 100% (96/96), done.
remote: Compressing objects: 100% (49/49), done.
remote: Total 76 (delta 49), reused 53 (delta 27), pack-reused 0
Unpacking objects: 100% (76/76), 38.04 KiB | 1.81 MiB/s, done.
From https://github.com/ohmybash/oh-my-bash
 * branch            master     -> FETCH_HEAD
   632fd71..4c2afd0  master     -> origin/master
Updating 632fd71..4c2afd0
Fast-forward
 completions/docker-compose.completion.sh  |  600 +----
 completions/docker.completion.sh          | 3013 +------------------------
 completions/fallback/docker-compose.bash  |  685 ++++++
 completions/fallback/docker.bash          | 5611 ++++++++++++++++++++++++++++++++++++++++++++++
 lib/omb-prompt-base.sh                    |   11 +-
 plugins/bashmarks/README.md               |   23 +-
 themes/THEMES.md                          |    4 +
 themes/bakke/bakke.theme.sh               |   10 +-
 themes/powerline/powerline.base.sh        |    6 +-
 themes/purity/purity.theme.sh             |    4 +-
 themes/robbyrussell/robbyrussell.theme.sh |   21 +-
 themes/roderik/roderik.theme.sh           |   21 +-
 12 files changed, 6451 insertions(+), 3558 deletions(-)
 create mode 100644 completions/fallback/docker-compose.bash
 create mode 100644 completions/fallback/docker.bash
         __                          __               __  
  ____  / /_     ____ ___  __  __   / /_  ____ ______/ /_ 
 / __ \/ __ \   / __ `__ \/ / / /  / __ \/ __ `/ ___/ __ \
/ /_/ / / / /  / / / / / / /_/ /  / /_/ / /_/ (__  ) / / /
\____/_/ /_/  /_/ /_/ /_/\__, /  /_.___/\__,_/____/_/ /_/ 
                        /____/                            
Hooray! Oh My Bash has been updated and/or is at the current version.
To keep up on the latest news and updates, follow us on GitHub: https://github.com/ohmybash/oh-my-bash

09:21:53 jan@two-arch ttf-gowun-batang ±|master ✗|→ sudo mv *ttf /usr/share/fonts/TTF/
[sudo] password for jan: 
sudo: _omb_util_alias_init_mv: command not found

Same for cp

This is on Arch Linux, 6.7.9-arch1-1, with GNU bash, version 5.2.26(1)-release (x86_64-pc-linux-gnu)

akinomyoga commented 3 months ago

The problem doesn't reproduce in my environment. I suspect sudo in your environment is defined to be an alias ending with a space. What is the result of the following command?

$ type -a sudo
stueja commented 3 months ago
11:40:00 ***@***.*** Downloads → type -a sudo
sudo is aliased to `sudo '
sudo is /usr/bin/sudo

Ah, yes, you are right, I forgot about that. I did that to use the alias "vim" which is mapped to "/usr/bin/nvim" also when prefixed with "sudo" (https://askubuntu.com/a/22043).

11:41:40 jan@two-arch Downloads → sudo vim --version
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1702233742

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
11:41:43 jan@two-arch Downloads → 
11:41:43 jan@two-arch Downloads → 
11:41:43 jan@two-arch Downloads → \sudo vim --version
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Mar 05 2024 22:43:21)
akinomyoga commented 3 months ago

OMB doesn't define that alias of sudo, so this is technically a conflict between OMB and the custom alias sudo. I wouldn't change the current settings of OMB, but you can work around it.

stueja commented 3 months ago

I went for unaliasing cp and mv, works like a charm. Thank you very much for your quick replies and fix!

akinomyoga commented 3 months ago

Great!