Skip to content

Instantly share code, notes, and snippets.

@itsDiwaker
Created April 12, 2020 14:51
Show Gist options
  • Save itsDiwaker/9a29dcc6191b516d24f0122ad04415f4 to your computer and use it in GitHub Desktop.
Save itsDiwaker/9a29dcc6191b516d24f0122ad04415f4 to your computer and use it in GitHub Desktop.
Create snake case mulitple empty files from camel case list of names
#! /usr/bin/env bash
files=(
ccPaymentTotal
getPaymentByMethodType
getTotalPaidByMethodType
getPointsBalance
getLineItemCountByState
getAggregateDiscountTypeForOrder
getAggregateDiscountTotalForOrder
)
for i in "${files[@]}"
do
echo ${i}.js | sed -E 's/([A-Z])/-\1/g' | tr '[:upper:]' '[:lower:]'
done
exit $EXT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment