I've been trying to write a bash script. A part of it is supposed to replace a part of a string with nothing.
Here's what I'm trying to do
$dbname=$1
$dbNameActual="${$dbname/.sql/}"
date
echo $dbNameActual
I tried a number of suggestions from stack. But got nowhere. I tried adding sed, but that didn't seem to work.
The idea is that I have a script, and it takes in a db import file name, say db250317.sql
and outputs db250317
.
I'm running Ubuntu 16.04 LTS.