V
V
Valery Ivanov2014-10-06 14:02:35
Command line
Valery Ivanov, 2014-10-06 14:02:35

How to write a shell script that reads a text file?

You need to write a small script, well, or with one command, which should read from the "Select_the_version" file, for example:
version: "1.2"
and execute cp -r /server/1.2/* /home/User/Server/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AlexanderMatveev, 2014-10-06
@valeragan

Head-on solution:

egrep '^version:' Select_the_version | awk -F\" '{print "/server/"$2"/*"}' | xargs -J % cp -r % /home/User/Server/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question