Skip to content

Instantly share code, notes, and snippets.

@xnekv03
Created February 17, 2023 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xnekv03/e849c8986765714325947df21921e15e to your computer and use it in GitHub Desktop.
Save xnekv03/e849c8986765714325947df21921e15e to your computer and use it in GitHub Desktop.
#!/bin/sh
export COUNTER=0
mkdir -p filesrenamed
for f in CREDIT_RATING_PREV_*; do result=$(mv $f ${f/${f:0:19}/CREDITRATING_T3_}) ; ((COUNTER++)); done 2> /dev/null
# exit status https://pubs.opengroup.org/onlinepubs/7908799/xcu/mv.html
# v rámci toho for cyklu bych dal podmínku - napíšu to zvlášt ale ty to musíš dát do for
var ok=0
if [ $result -eq 0 ]
then
ok ++
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment