解决$ 1:歧义重定向 [英] solve $1: ambiguous redirect

查看:335
本文介绍了解决$ 1:歧义重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此脚本定期将Postgresql的旧私有实例备份到gmail:

I'm using this script to backup an old private instance of postgresql to gmail periodically:

#!/bin/bash
/opt/local/lib/postgresql83/bin/pg_dump maxgests -U postgres | gzip --best -c > $1 && (/opt/local/bin/mutt -s `date "+%d-%m-%Y-%H:%M"` -a $1 $2 < /dev/null)

最近,我得到了这个:

./postgres_to_gmail.sh: line 2: $1: ambiguous redirect

该脚本不再起作用. Mac OS X 10.6.8.

And the script no longer works. Mac OS X 10.6.8.

任何音调都可以告诉您问题出在哪里以及如何解决吗?

Can anytone tell what's wrong and how to fix it?

第一个参数是路径,例如/tmp/database.gz

First argument is a path, like /tmp/database.gz

第二个参数是电子邮件.

Second argument is the email.

推荐答案

$1显然是空的.

作为一般指导,应该几乎总是将变量插值放在双引号中.

As a general guidance, you should put your variable interpolations in double quotes, nearly always.

这篇关于解决$ 1:歧义重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆