0

I have a first command in .sh file i.e.

cassandras3 backup --keyspace jl_powereasy_kespace --bucket database-backup-rds

This command asks a question when we run i.e.

Your cassandra data directory [/var/lib/cassandra/data]: 

how can I confirm this answer in shell script. I need to press enter for this confirmation automatically.

root@ip-172-31-2-150:/home/ubuntu# /bin/bash /var/cassandra_backupV1.sh
Your cassandra data directory [/var/lib/cassandra/data]: 
Nilesh
  • 2,054
  • 3
  • 23
  • 43

1 Answers1

1

As mentioned here, you can try running the command with echo as follows

echo -ne '\n' | cassandras3 backup --keyspace jl_powereasy_kespace --bucket database-backup-rds

or simply

echo | cassandras3 backup --keyspace jl_powereasy_kespace --bucket database-backup-rds
Bhavin
  • 206
  • 2
  • 9