LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 08-05-2007, 08:31 PM   #1
noonmid27
Member
 
Registered: Sep 2006
Posts: 79

Rep: Reputation: 15
Script help


Hi guys

ok i created this little installation script, which will make it easier for me to installpkgs on slackware 12.0. one of the lines in my script goes like this explodepkg packagename.gz |grep 'configure' | find -P -type f -name configure -exec configure. the output i get from this line is missing argument to 'exec'. how can i make the find command execute the configure file. even when i use ./configure i get the same result.
 
Old 08-05-2007, 08:58 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
Quote:
packagename.gz |grep 'configure' | find -P -type f -name configure -exec configure
There are a couple problems with this oneliner. Piping the output of grep to find doesn't make sense. Also when you are outside the package directory find may return configure from other directories as well.

Something like
explodepkg ${1} && cd "${1%.tar.gz}" && ./configure
might work better.

Even this isn't a good idea. It's always best to read the README and INSTALL files, and look at "./configure --help" first. There may be options that you want or need.
 
Old 08-06-2007, 10:10 AM   #3
noonmid27
Member
 
Registered: Sep 2006
Posts: 79

Original Poster
Rep: Reputation: 15
can you explain to me what the explodepkg ${1} && cd "${1%.tar.gz}" && ./configure means. i dont know what all the symbols mean. thx.
 
Old 08-06-2007, 11:01 AM   #4
muha
Member
 
Registered: Nov 2005
Distribution: xubuntu, grml
Posts: 451

Rep: Reputation: 37
An excellent guide on these basic shell features:
http://www.linuxcommand.org/wss0130.php
http://www.linuxcommand.org/wss0150.php

Also:
http://tldp.org/LDP/abs/html/paramet...stitution.html
Quote:
${var%Pattern}
Remove from $var the shortest part of $Pattern that matches the back end of $var.
 
Old 08-08-2007, 07:24 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
If you have a script, lets say, ~/bin/expl, and you include an argument of the package file, lets say abc-utils-1.1.tar.gz, then in the script, "${1}" is the first argument. It has the value of "abc-utils-1.1.tar.gz". "${1%.tar.gz}" strips of the .tar.gz extensions, leaving "abc-utils-1.1". Most packages when extracted will be contained in a directory by the same name of the package.

I don't use Slackware, so I'm not familiar with the explodepkg program and how it differs from untar'ing a package. But you can run it on its own and see what the new directory is named. It probably follows the same convention.
 
  


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
Calling perl script and passing variable from php script hosea Programming 5 10-21-2008 09:01 AM
Iptables (with masq) troubleshooting, very simple script attached script and logs. xinu Linux - Networking 13 11-01-2007 05:19 AM
i get an error message running php script inside a cgi script. repolona Linux - Software 0 02-22-2007 10:10 PM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 01:20 AM
linux 9 and java script error - premature end of script header sibil Linux - Newbie 0 01-06-2004 05:21 PM


All times are GMT -5. The time now is 10:51 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration