LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Blogs > GlennsPref
User Name
Password

Notices


Rate this Entry

How to save your rpm's for future reuse in Mandriva. p10 of 10

Posted 05-12-2010 at 12:23 AM by GlennsPref

Code:
	Now the reason I written this is because of a sed trick I found that converts the list to
 something urpmi can work with, This process is not completed yet, more things will occur to me as
 time rolls on, 

Code:
#!/bin/zsh 
echo "Create a space-separated-list from top-down list with preceeding chars." 
cd ~/build 

echo "remove old files" 
rm -f ~/build/file2.txt 
rm -f ~/build/file3.txt 

echo "Remove -  (dash space) from lead of lines using sed...." 
echo "sed 's/^[-\ ]*//' file1.txt (from file1.txt in pwd dir)" 

echo "redirect output to new file...file2.txt" 
sed 's/^[-\ ]*//' file1.txt > file2.txt 

echo "Now replace carriage returns with a space... using file2.txt, create file3.txt" 
sed ':a;N;$!ba;s/\n/ /g' file2.txt > file3.txt
First it removes the old files, to save stopping for errors, file exists. Then it removes the dash space from the head of the lines... And lastly it replaces the newline char with a space, bringing all the list to one line, sweet! I'd like to reference where most of my info came from, MDE repo http://www.mde.djura.org/index.html and SoS repo http://seerofsouls.com/ (website down atm), help files... Few years old now but still very useful. http://sed.sourceforge.net/sed1line.txt http://linux.dsplabs.com.au/rmnl-rem...-sam-ssam-p65/ And that's IT! Any questions? Did I miss something? Please ask!
Regards Glenn.
Posted in Uncategorized
Views 1226 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 05:18 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration