Re: [PATCH blktests v3 01/12] nvme/rc: Auto convert test device size info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On May 03, 2023 / 10:02, Daniel Wagner wrote:
[...]
> +convert_to_mb()
> +{
> +	local str=$1
> +	local res
> +
> +	res=$(echo "${str}" | sed -n 's/^\([0-9]\+\)$/\1/p')
> +	if [[ -n "${res}" ]]; then
> +		echo "$((res / 1024 / 1024))"
> +	fi
> +
> +	res=$(echo "${str}" | sed -n 's/^\([0-9]\+\)[mM]$/\1/p')
> +	if [[ -n "${res}" ]]; then
> +		echo "$((res))"
> +	fi
> +
> +	res=$(echo "${str}" | sed -n 's/^\([0-9]\+\)[gG]$/\1/p')
> +	if [[ -n "${res}" ]]; then
> +        	echo "$((res * 1024))"

Here are some spaces still  left.

> +	fi
> +}



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux