Tiny Core Linux

General TC => Programming & Scripting - Unofficial => Topic started by: aus9 on July 26, 2020, 10:08:39 PM

Title: script to search your local TCE.dep files for a named TCE
Post by: aus9 on July 26, 2020, 10:08:39 PM
firstly this is based a little on my poor memory of what a moderator supplied me years ago.
that script which I no longer had interacted with the repo.

this is a script that searches only your locally installed TCEs
it requires you to input the real name without the trailing .tcz

I stole a fair bit of coding from Rich forum post

I make it executable and have it in ~/.local/bin called searchtce
Code: [Select]
#!/bin/sh
read -t 10 -p "input TCE without dot tcz please
" INPUT
grep -l $INPUT.tcz /etc/sysconfig/tcedir/optional/*.dep | cut -d/ -f6

I added timer of 10 seconds. Use copy and paste if you are a slow typer or remove the timer please

Here is an example

Code: [Select]
searchtce
input TCE without dot tcz please
shared-mime-info
gtk2.tcz.dep
gtk3.tcz.dep
wicd.tcz.dep
xdg-utils.tcz.dep

It should be clear that all files ending in .dep are the "hits"

trivia
My main reason for using it is to track down what is loading a target TCE

there may be other uses. Hope it helps someone