Categories
How to split a line in bash?
Tell me how to get 2 variables from a string. With the name of the project and the rest of the string from https://github.com/USERNAME/REPOSITORIES get:
https://github.com/USERNAME/REPOSITORIES
url = https://github.com/USERNAME/ repa = REPOSITORIES
Answer the question
In order to leave comments, you need to log in
#!/bin/bash str="/usr/local/bin/blabla" str1=${str%/*} echo "[$str1]" str2=${str##*/} echo "[$str2]"
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question