bash - Parsing text file to variables -


$ cat file.txt example1@domain1-username 

i'd parse file.txt , export contents variables like:

var1=example1@domain1 var2=username 

var1=$(cut -d "-" -f 1 file.txt)  var2=$(cut -d "-" -f 2 file.txt) 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -