Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Script interpreting a command strangely
- X-seq: zsh-users 13703
- From: "Webb Sprague" <webb.sprague@xxxxxxxxx>
- To: "Zsh Users" <zsh-users@xxxxxxxxxx>
- Subject: Script interpreting a command strangely
- Date: Sun, 11 Jan 2009 20:09:31 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=8A20CH+dNaVYTFV9WleyEMgPRtu3gXLXFNBvo84ejZ0=; b=Dg+2EjuHVSATwIZDfG68hnFGGVRI6REEyuevf2bzgeTG9c4RH0Dz1CYJJsCYvvP9Z2 M9xNy00910DA12O+ipIElZyYaSZZsVs1DJWR1y5i2kOWBkHGi4GGmtbh8o0BSOVcfrZZ uIV4ROEyASeO4sFe+c8+BFcYzUMg+VFHNnq3c=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=RTuq5X59/dxUZGu0nRvgg83Ou32FiFos25YpzJ39O2id0eOS3szNqmbqrDPExd+i/8 99A/NyPJw2rUYSTiSP7spZCq8UnLn2oeG58Vb9P0N45OAJQMuduLj8I7ZuowCf88DHyd gmIEcBLMQORnUZyzmbVHYpr6abr0tQi+JE7Eo=
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
#!/usr/bin/env zsh
PGOPT=' -q -A -t -U mkn_f -h xxx.yyy.pdx.edu zzz' # command for DB
PG="psql $PGOPT "
psql $PGOPT
$PG
echo psql $PGOPT
If I run I get this I get
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Then:
./stupid.zsh:6: command not found: psql -q -A -t -U mkn_f -h
xxx.yyy.pdx.edu zzz
But if I run the echoed command it works just fine (the database and
host names have been changed to protect...) I guess zsh is first
running psql without passing it the options in $PGOPT, and then trying
to run a file name 'psql -A blah blah blah'. Neither of these seems
very sensical behaviors for a shell scripting language. Come someone
help me make it stop? Or tell me how to cope with it in a more
zsh-idiom? I find myself often putting a command with a bunch of
command switches. I am sure this has to do with wordsplitting, but I
am to stupid to figure it out. It seems that setopt shwordsplit is a
little drastic, too.
zsh --version: 4.2.6
If I run the script from bash I get
(0) dkar:~/MKN/importdata/bea-2008-01-07-CA-1-3 [0]% bash stupid.zsh
<861>
psql: could not translate host name "xxx.yyy.pdx.edu" to address: Name
or service not known
psql: could not translate host name "xxx.yyy.pdx.edu" to address: Name
or service not known
psql -q -A -t -U mkn_f -h xxx.yyy.pdx.edu zzz
This means that it understands the options and is trying to resolve xxx.yyy....
Tx
-W
Messages sorted by:
Reverse Date,
Date,
Thread,
Author