R
R
romasshka12019-01-02 22:03:13
bash
romasshka1, 2019-01-02 22:03:13

How to view the contents of a file?

It's a strange question, I know. The teacher gave me a task that I have been working on for a long time. You need to connect via ssh to a remote server, there is only ls and sh in / bin. Nothing else. And there is a file -data.txt- , the contents of which need to be viewed. Naturally, alias cannot be done, because, in principle, there are only 2 commands in bin. How can this be implemented? I suspect that with sh...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AVKor, 2019-01-02
@romasshka1

while read line; do name=$line; echo "$name"; done < data.txt

PS In fact, the tasks must be completed independently. To start, learn to google.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question