Reputation: 47
I want to refer file path through variable in script but not aware of syntax.
#!/bin/bash
filepath = /tibcouat1_fs/tibco/deployment/egypt/bnk/broker/logs/;
echo "============BNKBroker=============="
grep 'EXSTAT|' $filepath/bnkbroker.log
Find above script I have created where I am getting below error.
bash-3.2$ ./BNKSrvcList.sh
./BNKSrvcList.sh: line 2: filepath: command not found
============BNKBroker===== =========
grep: can't open /bnkbroker.log
bash-3.2$
Upvotes: 1
Views: 5461
Reputation: 6702
Try using this
filepath='/tibcouat1_fs/tibco/deployment/egypt/bnk/broker/logs/';
Upvotes: 3
Reputation: 4484
You can not have spaces at both sides of the equal sign (=), try this:
filepath=/tibcouat1_fs/tibco/deployment/egypt/bnk/broker/logs/
Upvotes: 4