Это прекрасно работает, если я делаю это самостоятельно в терминале:
Код: Выделить всё
[nixos@nixos:~]$ neofetch uptime | sed 's/30 mins/13.7 billion years/'
uptime: 13.7 billion years
Код: Выделить всё
neofetch uptime | sed 's/$(neofetch uptime | awk '/uptime:/ {print $2, $3, $4, $5}')/13.7 billion years/'
sed: can't read {print: No such file or directory
Код: Выделить всё
neofetch uptime | sed "s/$(neofetch uptime | awk '/uptime:/ {print $2, $3, $4, $5}')/13.7 billion years/"
uptime: 14 mins
Выполняем это с помощью скрипта: (script.sh):
Код: Выделить всё
uptime_value=$(neofetch uptime | awk '/uptime:/ {print $2, $3, $4, $5}')
echo "Found uptime_value:"
echo ${uptime_value}
neofetch uptime | sed "s/${uptime_value}/13.7 billion years/"
Код: Выделить всё
Found uptime_value:
34 mins
uptime: 34 mins
Подробнее здесь: https://stackoverflow.com/questions/790 ... h-neofetch