Example, I want to extract the first four character from serial and store it into version.
Code:
serial= 10001100
version=...(codes)....
echo $version
output in the terminal:
1000
Just to show you guys i havent been lazy...
Code:
#!/bin/bash
serial=10110011
echo $serial> serial.txt
version= cut -c1-4 serial.txt
echo $version
but this code saves the value into a text file. I want a code that does not save into any file whatsoever. Help? Thanks.