#!/bin/sh
Dir_name=`tar -tzf something-1.3.5a.tar.gz | head -1 | cut -f1 -d"/"`
echo $Dir_name
tar options details,
-t, --list
-z, --gzip, --ungzip filter the archive through gzip
-f, --force-local archive file is local even if has a colon
Здесь мы получаем список файлов в tar и берем первую строку с помощью head -1
cmd, извлекаем первое поле с помощью cut cmd.
Просто снова запустите pulseaudio
. Введите pulseaudio
, затем нажмите Enter.