LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-30-2010, 05:34 PM   #1
specialized
Member
 
Registered: Sep 2005
Location: Mar del Plata, Arg
Distribution: Always Slackware
Posts: 220

Rep: Reputation: 34
replace file1.tgz with another version of the same file


Hi guys!!

i have a bash question....
i got the slackware folder with my builds of my favorites packages, in /tmp i create the new versions of that packages. theres is a way in bash to replace the new ones in /tmp with the old ones in /home/user/slackware??

something like.....
in /tmp:
mv -i package1.tgz /home/user/slackware | and somethin to replace the old version of the app with the new one


thanx a lot guys
 
Old 05-31-2010, 12:23 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
I'm afraid I don't quite follow your question. Could you explain it in more detail please? Do you want to scan the entire directory and move files in bulk, or move individual files, for example? Perhaps you could show us the specific layout of your files, and what you want to do with them.
 
Old 05-31-2010, 02:28 AM   #3
tommyttt
Member
 
Registered: Oct 2009
Location: Federal Way, WA
Distribution: openSUSE 11.4 x86_64, openSuSE 12.1, Fedora 15
Posts: 207

Rep: Reputation: 34
Quote:
Originally Posted by specialized View Post
Hi guys!!

i have a bash question....
i got the slackware folder with my builds of my favorites packages, in /tmp i create the new versions of that packages. theres is a way in bash to replace the new ones in /tmp with the old ones in /home/user/slackware??

something like.....
in /tmp:
mv -i package1.tgz /home/user/slackware | and somethin to replace the old version of the app with the new one


thanx a lot guys
I also don't understand, why are you wanting to replace "newer" versions of packages with "older" ones? Are you trying to revert your slackware installation to a previous version?

After reading your post again, in one place you replace a "new" package with an "old" one but in the next paragraph you wabt to replace the "old" with the "new". Which way is it?

I'm not familiar with slackware so are you using package to refer to an application (program)? If so, the command you gave (mv -i filename /destination) should give you the desired results.

Tom

Last edited by tommyttt; 05-31-2010 at 02:43 AM.
 
Old 05-31-2010, 06:52 AM   #4
specialized
Member
 
Registered: Sep 2005
Location: Mar del Plata, Arg
Distribution: Always Slackware
Posts: 220

Original Poster
Rep: Reputation: 34
the bash script will do:

move the foobar002.txz to some folder, and replace it with foobar001.txz in that folder, its like an update of package, not installing of course
 
Old 05-31-2010, 06:53 AM   #5
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Sounds like you might want to look at the basename command.
 
Old 05-31-2010, 03:26 PM   #6
specialized
Member
 
Registered: Sep 2005
Location: Mar del Plata, Arg
Distribution: Always Slackware
Posts: 220

Original Poster
Rep: Reputation: 34
mmmm i will do
 
Old 06-02-2010, 05:26 PM   #7
specialized
Member
 
Registered: Sep 2005
Location: Mar del Plata, Arg
Distribution: Always Slackware
Posts: 220

Original Poster
Rep: Reputation: 34
i dont know how to do it........je
 
Old 06-05-2010, 07:30 AM   #8
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Can you tell us what you're having problems with please?
 
Old 06-05-2010, 04:19 PM   #9
specialized
Member
 
Registered: Sep 2005
Location: Mar del Plata, Arg
Distribution: Always Slackware
Posts: 220

Original Poster
Rep: Reputation: 34
its done, moving and replacing.....hard work

thanx anyway
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to replace a file with a newer version but keep the old file via a rename Joe_P Linux - Newbie 4 04-30-2009 04:51 PM
EnigMail version for Slackware Thunderbird 2.0 tgz Z038 Slackware 2 05-12-2007 11:14 PM
[Comp] How to create a file from the differences between file1 and file2 Xeratul Linux - Software 2 11-19-2006 02:20 PM
Finding lines in file1,but not in file 2 subu_s Programming 2 12-14-2004 10:56 AM
tgz file doesn't end in .tgz? detpenguin Slackware 4 05-15-2004 08:13 PM


All times are GMT -5. The time now is 10:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration