This is the development version of Kanrisuru. Since this is still a pre-1.0 release, we don't recommend using this in system-critical production environments.



Read an arbitrary set of lines from a file in ruby.

Basic Usage

host = '', username: 'ubuntu', keys: ['~/.ssh/id_rsa'])

result = host.read_file_chunk('/etc/crontab', 3, 5)

  [0] "# command to install the new version when you edit this file",
  [1] "# and files in /etc/cron.d. These files also have username fields,",
  [2] "# that none of the other crontabs do."


Field Type Description
path string
Required file path to get output chunk from.
start_line integer
Required line number to start reading from
end_line integer
Required line number to stop reading from


Returns an array of lines starting from the Kth line in the file, and ending in the Jth line.

Exit Status

Code Description
0 Success
1 Failure

Tested On

  • Ubuntu, Debian, Centos, Fedora, Redhat, OpenSuse, SLES