10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a file that I need to add 3 new lines of text for every line in the file - when I attempt the sed scripting below I keep getting 'command garbled' errors. Any suggestions would be greatly appreciated
for i in $list
sed ' a \... (7 Replies)
Discussion started by: bjdamon
2. UNIX for Dummies Questions & Answers
this is my first post so I don't know if I am doing this right.
I would like to append entries from a series of strings (contained in a text file) consecutively at the end of specifically labeled lines in another file.
As an example:
- the file that contains the values to be... (3 Replies)
Discussion started by: gus74
3. Shell Programming and Scripting
Hi i have 500 lines of file,each line i need to add another two lines also need to separate with one line for every 3 lines after adding two lines.How to achieve this using shell?
Input file :
output:... (4 Replies)
Discussion started by: buzzme
4. Shell Programming and Scripting
i have two files.
echo "unix linux forums"
now the output i need is
unix linux forums (3 Replies)
Discussion started by: snreddy_gopu
5. Shell Programming and Scripting
I'm reading in numbers from a file and trying to add them together. Here is the code so far. I know the 1+2+3.... part is wrong. The file has five numbers in it with each number on its own line. The numbers are decimals if that matters. Thanks.
while read EachLine
done <... (6 Replies)
Discussion started by: AxlVanDamme
6. Shell Programming and Scripting
I have XML file which i want to add 100 lines.I have no idea in xml how to add or modify data .Any help should be appreciated.
Akil (6 Replies)
Discussion started by: akil
7. UNIX for Advanced & Expert Users
I have a requirement like below.I need to Comment some lines in a file.
File contains following information.
I have a requirement like some times i need to comment lines 3 to before '}' and some... (1 Reply)
Discussion started by: ukatru
8. Shell Programming and Scripting
How to search string like: a and replace to
in a file with perl?
Grace (6 Replies)
Discussion started by: jinsh
9. Shell Programming and Scripting
I need to add a new lines with certain data, to an existing file, every 5 lines in the file.
There is no way to find any distinct charater pattern so
I will have to do a line count and then insert the new line.
I think using awk or sed is what I need to do.
Any help is appreciated.
Kunder (2 Replies)
Discussion started by: kunder
10. Shell Programming and Scripting
Hi, i have a file like:
and i need to add the other minutes with value 0 and have a file like:
00:06 ... (13 Replies)
Discussion started by: Lestat
Alien::Package::Rpm(3pm) User Contributed Perl Documentation Alien::Package::Rpm(3pm)
Alien::Package::Rpm - an object that represents a rpm package
This is an object class that represents a rpm package. It is derived from Alien::Package.
Relocatable rpm packages have a prefixes field.
Detect rpm files by their extention.
Install a rpm. If RPMINSTALLOPT is set in the environement, the options in it are passed to rpm on its command line.
Implement the scan method to read a rpm file.
Implement the unpack method to unpack a rpm file. This is a little nasty because it has to handle relocatable rpms and has to do a bit
of permissions fixing as well.
Prepare for package building by generating the spec file.
Delete the spec file.
Build a rpm. If RPMBUILDOPT is set in the environement, the options in it are passed to rpm on its command line.
An optional parameter, if passed, can be used to specify the program to use to build the rpm. It defaults to rpmbuild.
When retreiving the version, remove any dashes in it.
Set/get script fields.
When retrieving a value, we have to do some truely sick mangling. Since debian/slackware scripts can be anything -- perl programs or
binary files -- and rpm is limited to only shell scripts, we need to encode the files and add a scrap of shell script to make it
unextract and run on the fly.
When setting a value, we do some mangling too. Rpm maintainer scripts are typically shell scripts, but often lack the leading shebang
line. This can confuse dpkg, so add the shebang if it looks like there is no shebang magic already in place.
Additionally, it's not uncommon for rpm maintainer scripts to contain bashisms, which can be triggered when they are ran on systems
where /bin/sh is not bash. To work around this, the shebang line of the scripts is changed to use bash.
Also, if the rpm is relocatable, the script could refer to RPM_INSTALL_PREFIX, which is set by rpm at run time. Deal with this by
adding code to the script to set RPM_INSTALL_PREFIX.
Set/get arch field. When the arch field is set, some sanitizing is done first to convert it to the debian format used internally. When
it's retreived it's converted back to rpm form from the internal form.
Joey Hess <firstname.lastname@example.org>
perl v5.14.2 2011-08-05 Alien::Package::Rpm(3pm)