You are not logged in.
Pages: 1
Hi!
I am trying to easy some of my scripts a little, and would like to add somehting like:
pacman -U someprog.pkg.tar.gz into a variable for easy editing...first of all: Is this possible?
I have tried something like: program=`pacman -U someprog.pkg.tar.gz`
although, it doesn't seem to work
any ideas?
http://www.linuxportalen.com -> Linux Help portal for Linux and ArchLinux (in swedish)
Dell Inspiron 8500
Kernel 2.6.14-archck1 (selfcompiled)
Enlightenment 17
Offline
did you try it with "double qulotes" instead of `back tics`?
Offline
no didn't try that, thought it only applied to simple text/numbers not whole programs
thanks, will try it
http://www.linuxportalen.com -> Linux Help portal for Linux and ArchLinux (in swedish)
Dell Inspiron 8500
Kernel 2.6.14-archck1 (selfcompiled)
Enlightenment 17
Offline
No. If you want to set a command as a variable you use the double quotes. backtics are usually used within statements or even variables but not actually setting the variable equal to it. Example with backtics and double quotes:
today="Today is `date`"
echo $today
Offline
ok, thanks for clearing that up...
can I set more commands into one variable:
update="for app in $list; do pacman -S $app"
http://www.linuxportalen.com -> Linux Help portal for Linux and ArchLinux (in swedish)
Dell Inspiron 8500
Kernel 2.6.14-archck1 (selfcompiled)
Enlightenment 17
Offline
ok, thanks for clearing that up...
can I set more commands into one variable:
update="for app in $list; do pacman -S $app"
should be able to as long as $list and $app are defined before $update is called on.
Offline
ok, thanks a lot for your help, will try it tomorrow and post back my results
http://www.linuxportalen.com -> Linux Help portal for Linux and ArchLinux (in swedish)
Dell Inspiron 8500
Kernel 2.6.14-archck1 (selfcompiled)
Enlightenment 17
Offline
My thanks too. Now in ArchWD (pactk) user can run same style of command as in pacman. I always thought its for C only.
pactk -ip curvemenu
case $1 in
-ip)
pkgName="$2"
InstallPkg ;;
esac
Markku
Offline
Pages: 1