I'm writing a bash script. I have a variable which is something like:
What I want to do is create a new variable that removes the trailing ".out" portion of the variable. I would usually use sed for something like this. However, sed wants a file passed to it, not a line.
Is there a way to pass just a line to sed (without creating an intermediary file)? Or is there an even simpler way to do this in Bash alone (I'm sure there must be, but I'm somewhat new to Bash scripting and it doesn't jump out at me)?
Here's the type of thing I've been doing:
TITLE=`sed -e 's/^\(.*\)\.out/1/' < ${FILE}`
But this looks to pass the contents of the file "My_File.out" to sed, rather than the text "My_File.out" itself.