Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ [1] 2 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Script required to delete a list of files?, Undo mistakes in multi-app extensions< Next Oldest | Next Newest >
Juanito Offline





Group: Members
Posts: 1601
Joined: Sep. 2005
Posted: April 13 2008,05:56 QUOTE

In order to upgrade the versions of bison, pkg-config, expat, etc in compile-3.3.5, it would make life a lot easier if I had a script to delete a list of files. This would avoid starting again from the beginning and would avoid the hit or miss approach of hoping the new version of an app would completely overwrite the old version of an app.

If a list of files is produced by:
Code Sample
$ ./configure --prefix=/opt/test
$ make
$ touch mymarker
# make install
$ sudo find / -not -type 'd' -cnewer mymarker | grep -v "\/proc\/" | tee files

- then I was thinking I could replace "/opt/test/" with "/opt/compile-3.3.5/" in "files" and then call a script that would delete all the files in "files"

I would guess this would only require a couple of lines, but it is beyond my (almost non-existant) scripting ability...
Back to top
Profile PM 
^thehatsrule^ Offline





Group: Members
Posts: 3275
Joined: July 2006
Posted: April 13 2008,06:03 QUOTE

Why not uninstall them?

If you still have the source tree that has the same configure options, you can run `make uninstall`
Back to top
Profile PM 
Juanito Offline





Group: Members
Posts: 1601
Joined: Sep. 2005
Posted: April 13 2008,09:30 QUOTE

Ah, thanks - this did the trick:
Code Sample
$ ./configure --same options as when compiled
$ make
# make uninstall
Back to top
Profile PM 
^thehatsrule^ Offline





Group: Members
Posts: 3275
Joined: July 2006
Posted: April 13 2008,17:15 QUOTE

Quote (Juanito @ April 13 2008,05:30)
Ah, thanks - this did the trick:
Code Sample
$ ./configure --same options as when compiled
$ make
# make uninstall

Well, if you're just reconfiguring it, you don't need to build it - just do make uninstall right after.
Back to top
Profile PM 
roberts Offline





Group: Members
Posts: 4983
Joined: Oct. 2003
Posted: April 13 2008,17:32 QUOTE

Just to answer the original question, I find myself typing loops on the command line to process lists. Example:

# for F in `cat myfiles.lst`; do echo "$F"; done

This just echos back your list to insure that the loop is typed correctly.

I always start with a simple echo; just to be sure.

Sometimes I am paranoid and will then replace the echo with ls -1 to be sure that files that I think I am going to be processing are really there.

Then when I calm down I replace the command (echo or ls -1) with the actual command I wish to perform, usually sed -i, tr,awk, or rm

I know many times one could use find together with -exec, but that is not always available, so too, one could use find with xargs but I still uses loops on the command line.
Back to top
Profile PM WEB 
8 replies since April 13 2008,05:56 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ [1] 2 >/
reply to topic new topic new poll
Quick Reply: Script required to delete a list of files?

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code