Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 02-29-2004, 08:00 PM   #1
LQ Newbie
Registered: Feb 2004
Posts: 9

Rep: Reputation: 0
stripping of bash code?

Hi, all, I'm new to this forum so please be kind.

Anyways, I'm tring to install the Lexmark Z35 print drivers under my debian based system. So, I went to google and found a how-to. However, there is one snag, which is this

1. Untar that file. A disgusting self-extracting gzip file will fall
out. It's not near as nice as a shar file. Don't try to run it. It will
break things. Strip off the bash code till the END_OF_STUB marker, and
then save it as a .gz file.

How do I strip off the bash code inside this file? I thought it would be as easy as opening a text editor and just deleting the bash code. However, it's not, does anyone know how to proceed? Any help on this matter would be welcomed.

Old 02-29-2004, 10:49 PM   #2
LQ Guru
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
I've never done this, but a quick search on self-extracting gzips led to this HOWTO for creating one. Apparently, your self-extracting gzip has a few lines of bash code at the beginning that tells it how to extract itself, and it ends with the line "END_OF_STUB".

Anyway, that HOWTO has a bit of info that may help you get rid of it... check out the "automatically counting the header size" section. This command should tell you where the next line after END_OF_STUB is:

awk '/^END_OF_STUB/ { print NR + 1; exit 0; }' your_gzip_filename
Armed with that number, you can then run this command to extract the archive:

tail +the_number your_gzip_filename | tar xz
No guarantees

Last edited by wapcaplet; 02-29-2004 at 10:50 PM.
Old 03-01-2004, 08:51 AM   #3
LQ Newbie
Registered: Feb 2004
Posts: 9

Original Poster
Rep: Reputation: 0
Hey, thanks that worked!!!

My only other problem is tring to get this script to work. if any one would like to take a stab at it, please tell and I'll post the script.



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 help in explaining Bash code Linh Programming 4 07-09-2004 11:50 AM
Doubt with a bash code linuxlover1234 Programming 10 03-30-2004 01:48 PM
where is the bash source code?... gearoid Programming 5 11-25-2003 05:24 AM
Bug in c code calling bash code Linh Programming 11 08-12-2003 05:27 AM
Converting bash command to C code Linh Programming 3 06-13-2003 11:39 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:07 PM.

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