I'm trying to save the output of a command into files and it seems to work fine. However, when opening one of the files, I can see that output was limited to 80 characters width. How can I ensure that the output is not being wrapped? I've tried to put a tput rmam;
at the beginning of the shell script but it doesn't seem to change the output behavior.
Script:
#!/usr/bin/env bash
CPUS=$(cat /proc/cpuinfo | grep "processor" | wc -l)
ansible-doc -l | cut -d " " -f1 > modules.txt
parallel --tmpdir src/yaml-snippets --files -a modules.txt -j$CPUS ansible-doc -s {}
Example output:
- name: Module to manage datacenter quotas in oVirt/RHV
ovirt_quota:
auth: # (required) Dictionary with values needed to
create HTTP/HTTPS
connection to
oVirt: `username'
[`required'] -
The name of the
user, something
like
`admin@internal'.
Default value is
set by
`OVIRT_USERNAME'
environment
variable. `passwo
ansible-doc -l
command, or from the parallel'dansible-doc -s
command? Can you reproduce it without GNU parallel? – Jeff Schaller Apr 10 '19 at 01:57yum
uses python, I'd be curious if this hack/workaround also works foransible-doc
. – Jeff Schaller Apr 10 '19 at 02:04ansible-doc -s ovirt_quota
. However, executing it plain on the shell and executing it through parallel have different output size. – memoryleak Apr 10 '19 at 12:34script -q -c "stty cols 1000; ansible-doc -s $1 > src/yaml-snippets/$1.yml"
this line is called bycat modules.txt | xargs -t -n 1 -P$CPUS $DIR/generate.sh
– memoryleak Apr 11 '19 at 19:31-j
flag, or if you want to explicitly say it,-j100%
(which is the default).Also grep has a
– Larry Jun 29 '19 at 21:08-c
flag to count the number of matches, sogrep -c "processor" /proc/cpuinfo
will give you a count of the number of processors.