i need a command that lists the first few lines of files, i want to list the files first and then ask for a file to view
so far i have
#! /bin/bash
cd $1
ls
if [ "$(ls -A $1)" ]; then
read -p "show first few lines of files [y/n] " show
if [[ $show == [y] ]]; then
head -3...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.