Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Write an article for LinuxForums Today!
Try Our New Product Showcase!
Find the answer to your Linux question:
Advertisement
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Misc > Sed problem.

Forgot Password?
 Misc   Any questions or Linux discussion that does not fit in any of the other technical areas.

Site Navigation
Linux Forums
Linux Articles
Product Showcase
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds
Free Publications




Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 06-22-2003   #1 (permalink)
Linux Engineer
 
Join Date: Jan 2003
Location: Lebanon, pa
Posts: 994
Sed problem.

Ok I am trying to install digichat for a customer but in the install script it uses LD_ASSUME_KERNEL=2.2.5 which is a workaround for redhat releasing broken glibc. Well anyway that breaks a lot of other distros(i am using gentoo) because it causes binaries not to be able to find the correct libs. So I used sed to remove that from the install file but it seems to break gzip compressed files inside of it. This is the sed command I used:

sed -e '1986s/LD_ASSUME_KERNEL=2.2.5//' Install_DigiChat.bin > digi.bin

Anyone know of a way I can remove that line without corrupting the compressed files?
genlee is offline  



Reply With Quote
Old 06-22-2003   #2 (permalink)
Linux Guru
 
Join Date: Oct 2001
Location: Täby, Sweden
Posts: 7,578
Am I correct if I'm guessing that this DigiChat.bin is one of these shell scripts with an encapsulated tarball, and that you want to remove the LD_ASSUME_KERNEL lines before the tarball begins? In that case, just seperate the installer from the tarball with head and tail, run sed on the head part and then reassemble them with cat. That seemed too easy, though... was there anything else to it?
Dolda2000 is offline   Reply With Quote
Old 06-22-2003   #3 (permalink)
Linux Engineer
 
Join Date: Jan 2003
Location: Lebanon, pa
Posts: 994
I've tried seperating it but the compressed files always seem to get corrupted.
genlee is offline   Reply With Quote
Old 06-22-2003   #4 (permalink)
Linux Guru
 
Join Date: Oct 2001
Location: Täby, Sweden
Posts: 7,578
But if you seperate it, how can the compressed file be affected at all? How can sed touch it if you put it in a seperate file? I must be missing out on something.
Dolda2000 is offline   Reply With Quote
Old 06-22-2003   #5 (permalink)
Linux Engineer
 
Join Date: Jan 2003
Location: Lebanon, pa
Posts: 994
I know but when I put the files back together, gzip won't decompress it then.

gzip: /tmp/install.dir.26457/Linux/resource/vm.tar.Z: not in gzip format
/tmp/install.dir.26457/Linux/resource/vm.tar.Z: not in compressed format
genlee is offline   Reply With Quote
Old 06-22-2003   #6 (permalink)
Linux Engineer
 
Join Date: Jan 2003
Location: Lebanon, pa
Posts: 994
head -n 2218 Install_DigiChat.bin > i.bin
sed -e 's/LD_ASSUME_KERNEL=2.2.5//' i.bin > i2.bin
tail -n 153735 Install_DigiChat.bin > d2.bin
cat i2.bin d2.bin > digi.bin

omikron root # ./digi.bin
Preparing to install...
Extracting the JRE from the installer archive...
Unpacking the JRE...

gzip: /tmp/install.dir.26533/Linux/resource/vm.tar.Z: not in gzip format
/tmp/install.dir.26533/Linux/resource/vm.tar.Z: not in compressed format

gzip: /tmp/install.dir.26533/Linux/resource/vm.tar.Z: not in gzip format
The included VM could not be uncompressed (GZIP/UNCOMPRESS). Please try to
download the installer again and make sure that you download using 'binary'
mode. Please do not attempt to install this currently downloaded copy.
genlee is offline   Reply With Quote
Old 06-22-2003   #7 (permalink)
Linux Guru
 
Join Date: Oct 2001
Location: Täby, Sweden
Posts: 7,578
Ah, I get it, I think. I think these things have hardcoded offsets to where the compressed data begins. Try replacing the text with whitespace of the same length and see if that works.
By the way, you can use "tail +2218" instead of "tail -n 153735". It might not work in the latest version of coreutils, though. I don't know why they've removed it, but they seem to have done so. You can still use "tail -n +2218*, at least.
Dolda2000 is offline   Reply With Quote
Old 06-22-2003   #8 (permalink)
Linux Engineer
 
Join Date: Jan 2003
Location: Lebanon, pa
Posts: 994
Good idea I didn't think of that. Well it did work, now to work on the next error I get from it

./digi.bin: /tmp/install.dir.26698/Linux/resource/jre/bin/java: /bin/sh: bad interpreter: Permission denied
genlee is offline   Reply With Quote
Old 06-22-2003   #9 (permalink)
Linux Guru
 
Join Date: Oct 2001
Location: Täby, Sweden
Posts: 7,578
Now that's an interesting one... I'd fall back on good old strace.
Dolda2000 is offline   Reply With Quote
Old 06-23-2003   #10 (permalink)
Linux Engineer
 
Join Date: Jan 2003
Location: Lebanon, pa
Posts: 994
Yeah I fixed that error, I had /tmp mounted with noexec. After fixing that I have another error to fix:

Invocation of this Java Application has caused an InvocationTargetException. This application will now exit. (LAX)

Stack Trace:
java.lang.NoClassDefFoundError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:115)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvir onment(GraphicsEnvironment.java:53)
at java.awt.Window.<init>(Window.java:183)
at java.awt.Frame.<init>(Frame.java:310)
at java.awt.Frame.<init>(Frame.java:257)
at com.zerog.ia.installer.Main.c(Unknown Source)
at com.zerog.ia.installer.Main.main(Unknown Source)
at java.lang.reflect.Method.invoke(Native Method)
at com.zerog.lax.LAX.launch(Unknown Source)
at com.zerog.lax.LAX.main(Unknown Source)
GUI-
genlee is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Implementing Detailed User-Level Auditing of UNIX & Linux Systems
Enhance regulatory compliance and troubleshooting through detailed auditing, logging and real-time monitoring of UNIX/Linux user activity.
subscribe
Linux from Scratch - Receive Your Complimentary eBook NOW!
Linux from Scratch describes the process of creating your own Linux system from scratch from an already installed Linux distribution, using nothing but the source code of software that you need.
subscribe
A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)
Getting Started with Ubuntu 10.04 (Lucid Lynx) is a comprehensive beginners guide for the Ubuntu operating system; it features comprehensive guides, How Tos and information on anything you need to know after first installing Ubuntu.
subscribe
The Incredible Guide to NEW Ubuntu (Karmic Koala)
There are a lot of people still stuck with Windows because it's the ‘easier alternative'. Linux is both cheaper and more versatile than Microsoft's operating system, but the learning curve has frightened off many people.
subscribe
The GNU/Linux Advanced Administration
The GNU/Linux systems have reached an important level of maturity, allowing to integrate them in almost any kind of work environment, from a desktop PC to the sever facilities of a big company.
subscribe
A Newbie's Getting Started Guide to Linux
Learn the basics of the Linux operating systems. Get to know what it is all about, and familiarize yourself with the practical side. Basically, if you're a complete Linux newbie and looking for a quick and easy guide to get you started this is it.
subscribe
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe



All times are GMT. The time now is 07:47 AM.






© 2000 - - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.1