I want to find the number of records in a particular file and store that value in any other variable. I am trying this below command but it is not working and giving me an error "Uninary Operator Expected".
say I have taken a variable name 'count' in which I have to store the no. of records in a file.
count= wc -l <file name>
can u guys pls help me out...how i can store a no. of records in a variable
I also prefer this approach. For reference, surrounding the statement in parenthesis actually creates a sub-shell (another process). Putting the $ in front of it lets you use the result as a value.