Skip to content

Instantly share code, notes, and snippets.

@Mosharush
Last active October 6, 2023 16:43
Show Gist options
  • Save Mosharush/3a01c378632637939f3c43f3126d7a96 to your computer and use it in GitHub Desktop.
Save Mosharush/3a01c378632637939f3c43f3126d7a96 to your computer and use it in GitHub Desktop.
Bash Alias to run last wrong command wrote in Hebrew to the correct command :)
alias גררר="replace_hebrew_with_latin"
replace_hebrew_with_latin() {
previous_command=$(history | tail -n 1 | sed 's/^[ ]*[0-9]*[ ]*//')
latin_command=$(echo "$previous_command" | tr 'פםןוטארק׳/ףךלחיעכגדשץתצמנהבסז' 'poiuytrewq;lkjhgfdsa.,mnbvcxz')
# Display the translated command
echo "Translated Command: $latin_command"
# Ask for confirmation before executing
echo "Do you want to execute this command? [Press Enter again]"
read -r response
if [[ "$response" = "" ]]; then
eval "$latin_command"
else
echo "Command execution aborted."
fi
}
@hanokhaloni
Copy link

I think that the correct alias is גררר

@Mosharush
Copy link
Author

Mosharush commented Oct 4, 2023

I think that the correct alias is גררר

Accepted 👍

For examples:

עןא דאשאוד == git status
פטאיםמ כןךקץפט == python file.py

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment