troubleshooting Question

UNIX shell script question

Avatar of toooki
toooki asked on
Shell ScriptingLinuxUnix OS
6 Comments2 Solutions528 ViewsLast Modified:
I am writing the following command in the shell script:
var1=`/home/user1/Python/bin/bq --format prettyjson show mytab1 | grep "lastModifiedTime"`

The above returns:
  "lastModifiedTime": "1407393977076",

If I write:
var1=`/home/user1/Python/bin/bq --format prettyjson show mytab1 | grep "lastModifiedTime" | awk -F"\"" '{print $4}'`
The above returns 1407393977076

I only need the first 10 digits of the above number which is 1407393977
Could you please help me update the above command so that the above returns 1407393977 (not 1407393977076) ?
I need to preferably use a single command.
Thank you.

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros