LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-31-2006, 11:38 PM   #1
fanoliv
LQ Newbie
 
Registered: Jun 2006
Posts: 27

Rep: Reputation: 15
tar error in shell script


Hi everyone. I hope this is the appropriate forum.

I was trying to run a shell script to install some software. (I didn't write script and really don't know anything much about shell scripting, unfortunately.) There's a part in the script where it's tryting to uncompress some files using for loops. But every iteration of the loops resulted in the error below, and no file gets uncompressed. Can anyone please tell me what might be the problem here? Thanks.

Quote:
tar: dynamic-link.h:57: elf_get_dynamic_info: Assertion `! "bad dynamic tag"' failed.
./install.sh: line 228: 3241 Aborted tar -C ${INSTALL_DIR} -${BZIPOPT}xpf $x
PS: I'm using Fedora Core 5.
 
Old 10-31-2006, 11:59 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
The error sounds more like a problem with the .tar.bz file or the tar command itself.

One thing about the line I noticed:
Aborted tar -C ${INSTALL_DIR} -${BZIPOPT}xpf $x
The "x" option is for extracting, the "p" option is to preserve permissions. The "f" option precedes the file you want to untar. The error variable BZIPOPT sounds like it is options for bzip2. However the bzip2 compression option is "j" but I don't see it. Try sourcing the script so that you can find out what the value of BZIPOPT is. If it doesn't contain the letter "j" then you may need to add it somewhere. You can also use the "find" command to examine the tarball and find out if it indeed used bzip2 compression.
 
Old 11-01-2006, 12:17 AM   #3
fanoliv
LQ Newbie
 
Registered: Jun 2006
Posts: 27

Original Poster
Rep: Reputation: 15
The BZIPOPT value is below. Do I have to add the j option in this case? The files to be uncompressed are .tar.bz2 files. So hopefully they are really bzip2.

BZIPOPT='-use-compress-program=bunzip2 -'
 
Old 11-01-2006, 11:44 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
The particular error itself looks like it is coming from tar or a library that tar uses. But an assertion could be from an illegal input to a routine.

Your line would expand to something like:
tar -C /usr/local/bin --use-compress-program=bunzip2 -xpf tarball.tar.bz2

This command line is OK. The dash at the end of $BZIPOPT threw me off for a second. However it expands to the dash in 'xpf'. If compression wasn't used and BZIPOPT was empty, then the line would be like:
tar -C /usr/local/bin xpf tarball.tar.bz2
which is also OK. Tar was written before the convention on arguments.

If $INSTALL_DIR is an existing directory and $x is the name of a tarball, then this command looks correct. I had never used that long option and tried it out to make sure. I used bzip2 during compression and bunzip2 when extracting and it was successful.

---

What is this script you are trying to run? Is it an autoconf generated "configure" script? If so, and there is a configure.ac file present, you might try running autoconfig to recreate a new configure file. Also, running "ldconf" as root may update your library paths.

--

I downloaded the tar source code. There isn't a dynamic_link.h in the code, but perhaps it is loaded by another included file.
 
Old 11-04-2006, 03:52 AM   #5
fanoliv
LQ Newbie
 
Registered: Jun 2006
Posts: 27

Original Poster
Rep: Reputation: 15
Wink

Thank you very much for your help. The part about the config file is way over my head, I'm afraid. But I definitely need an attitude like yours to become a better programmer.

In any case, the script I was trying to run was for the RTLinuxPro installation. So I really had no idea why it wouldn't work since supposedly the company should have tested it. But since I was having so much problem with that version, I went and got another newer version that I've been able to install and boot successfully. Now that that's over with, I just have to figure out what exactly I'm gonna do for my final project.

Thank you very much for your help.
 
  


Reply



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
Help With A Shell Script Error PhantomFX Linux - Newbie 3 02-17-2005 04:42 AM
shell script q's (io, error exiting ) dave bean Programming 6 02-17-2005 01:24 AM
Tar files in a dir modified before 7 days in a shell script jayachristina Linux - Newbie 4 05-14-2004 02:49 AM
Shell Script Error Gerardoj Linux - General 2 12-03-2003 09:44 AM
Shell script error. chuck77 Linux - General 3 11-29-2001 11:30 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
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