LinuxQuestions.org
Visit Jeremy's Blog.
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 02-29-2004, 07:00 PM   #1
Lindows45
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.

Thanks,
Lindows45
 
Old 02-29-2004, 09:49 PM   #2
wapcaplet
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:

Code:
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:

Code:
tail +the_number your_gzip_filename | tar xz
No guarantees

Last edited by wapcaplet; 02-29-2004 at 09:50 PM.
 
Old 03-01-2004, 07:51 AM   #3
Lindows45
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.

Thanks,
Lindows45
 
  


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


All times are GMT -5. The time now is 09:29 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration