-1

I need to add / print a specific number of characters after and before a sentence with a line ..

Example:

I am having below:

SCRIPT OUTPUT

I need to display it as:

#############
SCRIPT OUTPUT
#############

And if it was:

SCRIPT OUTPUT FROM INPUTS

I would need this as:

#########################
SCRIPT OUTPUT FROM INPUTS
#########################

So, it depends on the length of the sentence. For sure, a one line command would be better.

Benjamin W.
  • 46,058
  • 19
  • 106
  • 116
mshafey
  • 89
  • 1
  • 9

1 Answers1

0

I managed and got what I needed: Thanks for your help ...

delim='#'
header='string'
echo $header|sed 's/./'$delim'/g'
echo $header
echo $header|sed 's/./'$delim'/g'
mshafey
  • 89
  • 1
  • 9