Re: to use linux commands inside idl [message #82623] |
Wed, 02 January 2013 02:26 |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On Tuesday, January 1, 2013 10:16:08 PM UTC-5, sid wrote:
> Hello everyone,
>
> I want to use the linux command inside the idl program
>
> My linux command is,
>
>
>
> sed -i 's/\(.*data=dblarr(4,ss2).*\)/data=dblarr(4,ss2)&ir=dbla rr(16)/g' progo_dark_limb0.pro
>
> now if I use $ sign it is not at all working.
You can't put $ signs in IDL programs, only use it from the command line.
> If I use spawn,'the above text' then error is coming like, illegal character in program text.
You are already using single quotes in the sed command. You can't just blindly but 'the above text' in single quotes because then it becomes
SPAWN, 'sed -i 's/jumbledymuck/g' progo_dark_limb0.pro'
and the s/jumbledymuck/ portion is no longer quoted at all. Use
SPAWN, "the above text"
with double quotes instead. It gets really fun (in a bad way) if your Unix command has both types of quotation marks.
Craig
|
|
|