You are not logged in.

#1 2006-08-17 10:24:07

kriga
Member
Registered: 2005-04-04
Posts: 27

Problem with a bash script

A the moment I try to build up a small linux system from scratch using LFS and paco package manager.

Now I've wrote a simple script to install a tarball onto my system and uses paco to log all installed files.

#!/bin/bash

FILE=`basename $1`
ROOT="/"

echo "** Installing:  "$FILE

PKGNAME="`echo $FILE | sed -e 's/.pkg.tar.gz//g'`"
echo "** Pkgname: "$PKGNAME

COMMAND="paco --log --package=$PKGNAME 'tar xvfz $1 -C $ROOT'"
echo "** Executing: "$COMMAND
$COMMAND

When I call this script with an argument with the name of the tarball to install

root:/# pkgadd /tools/src/pkgs/glibc#2.3.6-2.pkg.tar.gz
** Installing:  glibc#2.3.6-2.pkg.tar.gz
** Pkgname: glibc#2.3.6-2
** Executing: paco --log --package=glibc#2.3.6-2 'tar xvfz /tools/src/pkgs/glibc#2.3.6-2.pkg.tar.gz -C /'

I got this error message:

paco: '-Cl': Incompatible options
Try 'paco --help' for more information

but I think that the problem is not the programm paco as it seems, it's somehow the script. If I cut&paste the executed command (paco --log --package=glibc#2.3.6-2 'tar xvfz /tools/src/pkgs/glibc#2.3.6-2.pkg.tar.gz -C /' ) everything works fine.

Does any body maybe see the problem?!?

Thanks!

-kriga

Offline

#2 2006-08-17 10:41:20

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: Problem with a bash script

try double quotes around your args:

COMMAND="paco --log --package="$PKGNAME 'tar xvfz $1 -C $ROOT'"" 

Offline

Board footer

Powered by FluxBB