1
I have the following command:
cat frutas.txt | tail -n 1 | cut -d: -f 1
This command returns an integer to the terminal. How do I send this value to a variable? I tried something like this:
resl=cat frutas.txt | tail -n 1 | cut -d: -f 1
But it was a mistake:
-bash: . /fruit.txt: Permission denied
Contents of the file fruta.txt
:
1:cereja:223
2:maça:23