From 49f0e904a9283ac1e0744795cc470eb296706f05 Mon Sep 17 00:00:00 2001 From: brian-level Date: Fri, 14 Jun 2024 06:20:38 -0400 Subject: [PATCH] simplify shell --- script/generate | 4 ++-- script/util | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/script/generate b/script/generate index d476710c..61614c46 100755 --- a/script/generate +++ b/script/generate @@ -118,7 +118,7 @@ trust_sdk_and_extensions() # Parse extension name local extension_name="" extension_line=$(grep -m 1 'id: ' "${slce_file}") - extension_name="$(echo ${extension_line//id:/})" + extension_name="${extension_line//id:/}" # Define symlink location local extension_symlink="${sdk_dir}/extension/${extension_name}" @@ -176,7 +176,7 @@ generate() local slcp=${1?A .slcp file is expected as the first argument} local project_name="" project_line=$(grep 'project_name: ' "${slcp}") - project_name="$(echo ${project_line//project_name:/})" + project_name="${project_line//project_name:/}" local generation_dir=${2?A generation output dir is expected as the second argument} local export_templates="${repo_dir}/slc/exporter_templates/platform_library" local board=${3?A board is expected as the third argument} diff --git a/script/util b/script/util index fd3ba267..93ea759c 100644 --- a/script/util +++ b/script/util @@ -86,13 +86,13 @@ parse_configuration() set +e # grep raw values from the configuration file line="$(grep 'rcp_uart_slcp:' "${config_yml}")" - rcp_uart_slcp="$(echo $line//rcp_uart_slcp:/)" + rcp_uart_slcp="${line//rcp_uart_slcp:/}" line="$(grep 'rcp_spi_slcp:' "${config_yml}")" - rcp_spi_slcp="$(echo $line//rcp_spi_slcp:/)" + rcp_spi_slcp="${line//rcp_spi_slcp:/}" line="$(grep 'soc_slcp:' "${config_yml}")" - soc_slcp="$(echo $line//soc_slcp:/)" + soc_slcp="${line//soc_slcp:/}" line="$(grep 'board:' "${config_yml}")" - board="$(echo $line//board:/)" + board="${line//board:/}" # Strip quotes rcp_uart_slcp=$(eval echo "${rcp_uart_slcp}")