Abstract
The third cut problem from HackerRank.
Cut 3#
Problem#
Display a range of characters starting at the \(2^{nd}\) position of a string and ending at the \(7^{th}\) position (both positions included).
Input Format#
A text file containing \(N\) lines of ASCII text only.
Constraints#
\(1 \le N \le 100\)
Output Format#
The output should contain \(N\) lines. Each line should contain the range of characters starting at the \(2^{nd}\) position of a string and ending at the \(7^{th}\) position (both positions included).
Sample Input#
Hello
World
how are you
Sample Output#
ello
orld
ow are
Solution#
#!/usr/bin/env bash
# shellcheck disable=SC2162
while read line_txt; do
echo "${line_txt}" | cut -c 2-7
done