I use cookies to optimize the website; third party service embeds (YouTube, SoundCloud, etc) may set these too. Use Privacy Badger to protect yourself.
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Would it be possible to use this technique to convert from exponential notation to decimal?
e.g convert 1.3e-2 ->0.013
Honestly, I have no idea. I often have to use a "try, try again" approach to SED.
I'd think AWK might be a more useful tool for that, though – and perhaps a little easier to understand.
Thanks for your post, I have crated a small function to make it reusable for scripting.
function padding () {
CONTENT="${1}"; PADDING="${2}"; LENGTH="${3}"; TRG_EDGE="${4}";
case "${TRG_EDGE}" in
left) echo ${CONTENT} | sed -e :a -e 's/^.{1,'${LENGTH}'}$/&'${PADDING}'/;ta'; ;;
right) echo ${CONTENT} | sed -e :a -e 's/^.{1,'${LENGTH}'}$/'${PADDING}'&/;ta'; ;;
center) echo ${CONTENT} | sed -e :a -e 's/^.{1,'${LENGTH}'}$/'${PADDING}'&'${PADDING}'/;ta'
esac
return ${RET__DONE};
}
Usage: echo "IP Address:
padding "${IP_ADDRESS}" "${PADDING}" ${LENGTH}
webserver";Hope you find it of any use.
In the end, I found this post !
Thank YOU !