#!/bin/bash
num=$(gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings | grep -oE '[0-9]+'|sort -rn|head -n 1)
key=$(gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings)
newnum=$(grep -oE '[0-9]+' $key |sort -rn|head -n 1)
echo $newnum
grep
takes the $key
as filename, but I want it to search the text stored in the variable $text
.
echo "${key}" | grep ...