执行vertica查询时如何在shell脚本中打印错误?

时间:2018-11-09 05:58:53

标签: linux shell vertica

我要在分配的变量中打印错误

Dim sNode1 As String

With ThisWorkbook.Worksheets("Sheet1")

    'This nodeList is retrieving the values inside the DIV class="a69"
    'it's a list of products

    sNode1 = NodeList1.Item(0).innerText

    For i = 0 To NodeList.Length - 1

        .Cells(i + 1, 1) = NodeList.Item(i).innerText
        .Cells(i + 1, 8) = sNode1

    Next

End With

1 个答案:

答案 0 :(得分:0)

您需要使用stderrstdout重定向到2>&1,如果命令有错误,您将得到错误:

#!/bin/bash
a=$(vertica copy query 2>&1) # if i got error here 
echo $a