populating array file should basic, can't work. #!/bin/bash declare -a i=0 cat "file.txt" | while read line; a[$i]="$line" i=$(($i + 1)) done echo "${a[0]}" this prints empty line. file contains lines "foo" , "bar", here's output bash -x: + declare -a + i=0 + cat file.txt + read line + a[$i]=foo + i=1 + read line + a[$i]=bar + i=2 + read line + echo '' i can't readarray builtin working: #!/bin/bash declare -a b cat "file.txt" | readarray b echo "${b[0]}" + declare -a b + cat file.txt + readarray b + echo '' what doing wrong here? this basic bash pitfall: segments of pipeline execute in subshells default, means whatever variables create go out of scope when these subshells terminate (the current shell won't see them). depending on version of b...
i trying change primary key in 1 of tables int uniqueidentifier. pointed out in title, taking database first approach using entity framework. the process took remove primary key table in sql designer , renamed column "itemid" "item". i created column named "itemid" , set uniqueidentifier type default newsequentialid(). then deleted column renamed "item" , set "itemid" primary key. i moved visual studio , did update model database gave me error error 1 error 2019: member mapping specified not valid. type 'edm.int32[nullable=false,defaultvalue=]' of member 'itemid' in type 'shoppingmodel.dbfruits' not compatible 'sqlserver.uniqueidentifier[nullable=false,defaultvalue=,storegeneratedpattern=identity]' of member 'itemid' in type 'shoppingmodel.store.dbfruits'. and here model under .tt directory public partial class dbfruits { public dbfruits() { thi...
Comments
Post a Comment