linux_config_scripts/scripts/git_clone_star_repos.sh

18 lines
642 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
## Ввести имя пользователя
USERNAME="Azmandios"
## создание массива и заполнение его выводом команды
declare -a arr=$(curl -s https://api.github.com/users/$USERNAME/starred?per_page=100 | jq '.[]|.clone_url' )
## перебор массива и печать списка репозиториев во временный файл
for item in "${arr[*]}"
do
test=$(printf " %s\n" $item|sed 's/^/git clone/' > git_clone_list_url.txt)
done
## выполнение клонирования списка репозиториев
bash git_clone_list_url.txt