无法在Bash中执行TAR

问题描述 投票:0回答:1

我在终端上输入此行:

tar -czf temp.tar.gz  aDirectory/*

有效。

我将此行添加到bash脚本中:

invalid command name "tar"
    while executing
"tar -czf temp.tar.gz  aDirectory/*"
    (file "./backup" line 3)

我也曾尝试在tar之前加/usr/bin。同样的问题。

为什么?

linux bash unix centos tar
1个回答
0
投票

错误消息看起来像是从报告的。

[STEP 105] $ cat foo.tcl
# line 1
# line 2
tar -czf temp.tar.gz  aDirectory/*
[STEP 106] $ tclsh foo.tcl
invalid command name "tar"
    while executing
"tar -czf temp.tar.gz  aDirectory/*"
    (file "foo.tcl" line 3)
[STEP 107] $
© www.soinside.com 2019 - 2024. All rights reserved.