1

Need to query a certain value from each file in a directory and put it in a file. I use the code:

#!/bin/bash 

ls -lrt | grep -w  "458752" | awk '{print $9}' | sort -V > list

for linename in cat list 
do 

/d/home/alima0152/Desktop/sqlite3 $linename "select trace_count from volume"; >> trc_count 

done 

rm list 

But I get this error:

file is encrypted or is not a database

1
  • I am also using the latest version of sqlite3 Commented Oct 16, 2016 at 1:46

1 Answer 1

1

This code is trying to open the files cat and list.

To execute something and insert its output, use `...` or $(...):

for linename in $(cat list)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.