Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [fold]

a filter that folds lines to a specified width. Use this tag if you are using the fold utility to format files or text

0
votes
1answer
20 views

fold: outputs only the first character

I am using fold to make an array of characters from a string. INPUT=$1 arr=($(fold -w1 <<< "$INPUT")) echo "$arr" echo "$arr[@]" I use command ./myProgram 1234 to execute the script. ...
3
votes
6answers
172 views

unicode safe alternative for fold

I'm using fold -w 3 to split a line into multiple 3 chars long, however with the GNU implementation, it does not work for text with multi-byte characters it seems. How can I achieve the above with ...
6
votes
3answers
1k views

Wrap and indent text using coreutils

Short version I would like to create a tabular display of multiline text, similar to the following: all Build all targets document Create documentation of source files in the subfolders ...
7
votes
2answers
4k views

How to wrap output of watch command?

Consider the following command: watch -d "ps -ef | grep java" It gives following output: kshitiz 11369 11285 0 Oct13 ? 00:06:02 /usr/lib/jvm/jdk1.7.0_40/jre/bin/java -Djava.awt.headless=...