Can you call external shell command from the script?

I would like to reformat the entire document so that the line width is, say, 60 characters. If I have file.txt, the following shell command will do:

fmt -w 60 file.txt

or alternatively using pipe

cat file.txt | fmt -w 60

How to do this in Kate? Ideally, I would like to be able to select text, pipe it into fmt, and replace the selection with the output of fmt.

Reply

  • You can use Markdown syntax to format and style the text.
  • You may link to images on this site using a special syntax
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.