I have a command that extract a word  from a file.I want to rename that file using the word it extracted.The command I use to extract the word, which I will use later to rename filename.txt, is the following:$ grep -e some words -e other words filename.txt | awk '{print $1}' filename.txt content example:dasdadasasdasdaasdasmatched some wordsasdasasdaExpected result: filename.txt will be renamed to matched.txt.Im kinda hoping this can be done using one-liner command.This is won't work but maybe something like:mv filename.txt $(grep -e some words -e other words filename.txt | awk '{print $1}').txtNote: Im certain that there will only be one match with thegrep`.Thanks.
one-liner command to rename a file using the output of another command
awk;grep;rename;mv