linux - shell script concatenate with space two string -
i’ve shell script need provide following pattern in txt file
test0000 test0000@gmail.com test0001 test0001@gmail.com
and on until stop condition (10 in case...)
currently not working , tried following:
start=“test” email=“@gmail.com" start=0 stop=10 i=0 while [[ $i -le 10 ]] printf "%s%10d\n" "$start” "$i" "\n" "$start” "$email"
any idea how resolve ? got error: "@gmail.com:" invalid number
you can use:
start='test' email='@gmail.com' ((i=0; i<10; i++)); printf '%s%04d %s%04d%s\n' "$start" $i "$start" $i "$email" done test0000 test0000@gmail.com test0001 test0001@gmail.com test0002 test0002@gmail.com test0003 test0003@gmail.com test0004 test0004@gmail.com test0005 test0005@gmail.com test0006 test0006@gmail.com test0007 test0007@gmail.com test0008 test0008@gmail.com test0009 test0009@gmail.com
Comments
Post a Comment