Question: Create a script such that it is a command that has the same effect as the "less" command (implement the script by calling "less").

What I wrote:

#! /bin/bash
for index in "$@"
do
  less "$index"
done

Apparently this is wrong. Any suggestions?

link|improve this question

0% accept rate
feedback

1 Answer

Why not this..

#!/bin/bash
less "$@"

Although i guess what your teacher meant was to make a script which works like less without using less.

link|improve this answer
I know why you are guessing that but your answer was correct...this question is so retarded... – Anson Jan 16 at 5:53
unless you are asked to add some other functionality, the question your teacher has given doesnt make much sense. – daya Jan 16 at 5:55
Well I am guessing he asked such an easy question in our assignment was meant to let us be familiar with the usage of $@....thanks – Anson Jan 16 at 6:01
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.