slitaz-tools rev 1031
Remove cat process
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Oct 20 12:35:57 2019 +0200 (2019-10-20) |
parents | 7cbf5f11d543 |
children | c8483f7766ba |
files | tazbox/tazbox tinyutils/hwsetup |
line diff
1.1 --- a/tazbox/tazbox Mon Apr 15 10:15:58 2019 +0200 1.2 +++ b/tazbox/tazbox Sun Oct 20 12:35:57 2019 +0200 1.3 @@ -70,7 +70,7 @@ 1.4 system_desktop=$(find /usr/share/applications \ 1.5 -name ${1##*/}.desktop 2&>/dev/null | head -n1) 1.6 desktop="${local_desktop:-$system_desktop}" 1.7 - [ -n "$desktop" ] && cat $desktop | sed '/\[Desktop\ Entry\]/,/^\[/!d' | \ 1.8 + [ "$desktop" ] && sed '/\[Desktop\ Entry\]/,/^\[/!d' $desktop | \ 1.9 sed '/^Icon=/!d' | head -n1 | cut -d= -f2 1.10 } 1.11 1.12 @@ -384,13 +384,13 @@ 1.13 grep -m1 $(basename $tzfile) $ztab 1.14 done | cut -d$'\t' -f1 | sort -u > $tmpcc 1.15 1.16 - for CC in $(cat $tmpcc); do 1.17 + while read CC; do 1.18 cat << EOT 1.19 $CC 1.20 $CC 1.21 $(grep -m1 "$CC " ${zi}iso3166.tab | cut -d$'\t' -f2 | sed 's|\&|&|g') 1.22 EOT 1.23 - done | \ 1.24 + done < $tmpcc | \ 1.25 yad --title="$(_ 'SliTaz TZ')" --window-icon="$icon" \ 1.26 --width='500' --height='380' --on-top --center \ 1.27 --image="$icon" --image-on-top \ 1.28 @@ -575,7 +575,6 @@ 1.29 fi 1.30 1.31 icon='preferences-desktop-locale' 1.32 - cat $PKGS_LIST | \ 1.33 { 1.34 yad --title="$(_n 'Manage locale packages')" --window-icon="$icon" \ 1.35 --width='600' --height='400' --on-top --center \ 1.36 @@ -589,7 +588,7 @@ 1.37 --button="$(_n 'Install/Remove')!gtk-execute:2" \ 1.38 --button="gtk-cancel:1" \ 1.39 --print-all 1.40 - } > $ANSWER 1.41 + } < $PKGS_LIST > $ANSWER 1.42 1.43 case "$?" in 1.44 1) rm_temp; exit 0;;
2.1 --- a/tinyutils/hwsetup Mon Apr 15 10:15:58 2019 +0200 2.2 +++ b/tinyutils/hwsetup Sun Oct 20 12:35:57 2019 +0200 2.3 @@ -177,7 +177,7 @@ 2.4 count=1 2.5 2.6 # assume device to be in last 3 entries; use tac 2.7 - DEVICES_LIST=$(cat /proc/bus/usb/devices | grep ^[TDP] | \ 2.8 + DEVICES_LIST=$(grep ^[TDP] /proc/bus/usb/devices | \ 2.9 grep -B1 -A1 "$PATTERN" | grep -i vendor | awk ' { print $2,$3 } ' | \ 2.10 sed 's/ / /'|sed 's/Vendor=//' | sed 's/ProdID=//' | tail -3) 2.11 _ 'Detected USB Device : Vendor : Product'