From 4686927952a61867ebafc8f8e9721110dc5e2f8e Mon Sep 17 00:00:00 2001 From: masquevil Date: Sun, 17 Mar 2024 02:05:13 +0800 Subject: [PATCH] [shell] bug fix --- shell/copy.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shell/copy.sh b/shell/copy.sh index b5acd15..e947a96 100755 --- a/shell/copy.sh +++ b/shell/copy.sh @@ -1,7 +1,8 @@ -#!/bin/bash +#!/bin/sh # 复制 local/*.example.ts 到 local/*.ts for file in src/local/*.example.ts do - cp "$file" "${file//.example.ts/.ts}" + new_file=$(echo "$file" | sed 's/\.example\.ts/\.ts/') + cp "$file" "$new_file" done