Bash: Syntax error: redirection unexpected

后端 未结 9 1690
终归单人心
终归单人心 2020-11-27 12:30

I do this in a script:

read direc <<< $(basename `pwd`)

and I get:

Syntax error: redirection unexpected

9条回答
  •  遥遥无期
    2020-11-27 12:44

    In my case error is because i have put ">>" twice

    mongodump --db=$DB_NAME --collection=$col --out=$BACKUP_LOCATION/$DB_NAME-$BACKUP_DATE >> >> $LOG_PATH
    

    i just correct it as

    mongodump --db=$DB_NAME --collection=$col --out=$BACKUP_LOCATION/$DB_NAME-$BACKUP_DATE >> $LOG_PATH
    

提交回复
热议问题