Link to home
Start Free TrialLog in
Avatar of Christian Palacios
Christian PalaciosFlag for Canada

asked on

Linux create command with double quotes

Hi there,

I'm trying to dynamically create this string in a variable so that I can then run "eval" on it and run the command remotely on another Linux VM.

ssh oracle@10.41.22.69 "md5sum /data/oracle/dpdump/onegeo/ONEGEO20171214.DMP | awk '{ print \$1 }'"

I can get the string working until the "awk" part and then no matter what I try, I keep getting errors when trying to properly create the rest of the string with single quotes.  The double and single quotes in the string are all required.  

I tried this but it didn't work, what am I missing?
md5command='ssh oracle@10.41.22.69 "md5sum /data/oracle/dpdump/onegeo/'$DMPfilename' | awk '\'{ print \$1 }\''

Any help would be appreciated!!

Thanks,
- Christian
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Christian Palacios

ASKER

Thanks a lot ozo!  That worked!