Problem in skill

  • Thread starter sridhartv25@gmail.com
  • Start date
S

sridhartv25@gmail.com

Guest
Hello all,

In skill code I have saved some data in a variable.
And I want to access the value of that variable in the csh or the
system command , how can I do that
I tried using csh(echo $variable) but its not working.

Thanks & Regards,
Sridhar.
 
sridhartv25@gmail.com wrote, on 05/29/09 13:19:
Hello all,

In skill code I have saved some data in a variable.
And I want to access the value of that variable in the csh or the
system command , how can I do that
I tried using csh(echo $variable) but its not working.

Thanks & Regards,
Sridhar.
You mean that you want to send the value of the variable to csh or system?

If so, I think you probably want something like:

csh(sprintf(nil "echo '%s'" variable))

I put '' around the value in case it had spaces in it. Essentially I'm using
sprintf to build the command that csh will invoke.

Regards,

Andrew.
 
Hello Andrew,

Thanks for your reply,
What I actually require is that , I am trying to send a mail with the
help of mail command in unix, I have stored the mail adresses list in
the variable.
csh("mail -s Sridhar {variable} < /user/ssy/message.il")

Now here how can I print the mail adresses list in the mail command ,
I think I cannot use the sprintf command directly there.
One more thing is that , to bulid the list of email adresses I am
using the buildString command now in this list I have got duplicates
of the same email id's how can I remove this dupilcates.
ex:
a="nil,abc@ams.com,abc@ams.com,abc@ams.com,hfg@ams.com"
Now I want saome thing like,
a="nil,abc@ams.com,hfg@ams.com"
Is it possible to remove these duplicates with rexcompile and
rexreplace command or else any other alternative is there.

Regards,
Sridhar.
 
Hello Andrew,

Thanks for your reply,
What I actually require is that , I am trying to send a mail with the
help of mail command in unix, I have stored the mail adresses list in
the variable.
csh("mail -s Sridhar {variable} < /user/ssy/message.il")

Now here how can I print the mail adresses list in the mail command ,
I think I cannot use the sprintf command directly there.
One more thing is that , to bulid the list of email adresses I am
using the buildString command now in this list I have got duplicates
of the same email id's how can I remove this dupilcates.
ex:
a="nil,a...@ams.com,a...@ams.com,a...@ams.com,h...@ams.com"
Now I want saome thing like,
a="nil,a...@ams.com,h...@ams.com"
Is it possible to remove these duplicates with rexcompile and
rexreplace command or else any other alternative is there.

Regards,
Sridhar.
 
sridhartv25@gmail.com wrote, on 06/01/09 12:31:
Hello Andrew,

Just I thought that I had not given a clear information.

csh("mail -s Sridhar {variable} < /user/ssy/message.il")

In the above command "/user/ssy/message.il" is the file whose
contents will be sent to list of email ids written after the subject
( Here itis -s Sridhar).
In the skill I am storing all the email ids in a variable say a .
Now how can I pass these list of email ids to this command

csh("mail -s Sridhar {list of email ids} < /user/ssy/message.il")

Regards,
Sridhar.
Isn't this just:

procedure(ABremoveDups(lst)
let((dupTable)
dupTable=makeTable('noDups nil)
foreach(member lst dupTable[member]=t)
dupTable->?
)
)

emailAddresses=buildString(ABremoveDups(listOfEmailIds) ",")
csh(sprintf(nil "mail -s Sridhar %s < /user/ssy/message.il"
emailAddresses)

You could of course combine these two statements without needing the
intermediate variable:

csh(sprintf(nil "mail -s Sridhar %s < /user/ssy/message.il"
buildString(ABremoveDups(listOfEmailIds) ","))

Regards,

Andrew.
 
Hello Andrew,

Just I thought that I had not given a clear information.

csh("mail -s Sridhar {variable} < /user/ssy/message.il")

In the above command "/user/ssy/message.il" is the file whose
contents will be sent to list of email ids written after the subject
( Here itis -s Sridhar).
In the skill I am storing all the email ids in a variable say a .
Now how can I pass these list of email ids to this command

csh("mail -s Sridhar {list of email ids} < /user/ssy/message.il")

Regards,
Sridhar.
 
sridhartv25@gmail.com wrote, on 06/01/09 15:12:
Hello Andrew,

Thanks for your reply,
Regarding removing dupilcates
I am getting an error as -
*Error* foreach: second argument must be a list
May be this could be because the return value of buildString is not a
list


emailAddresses=buildString(ABremoveDups(listOfEmailIds) ",")
for the above statement I have checked listp(emailAddresses) the
answer is nil.
How can I resolve this problem Andrew.

Regards,
Sridhar.
No, because in my code buildString is used on the result of ABremoveDups - so
the return value of it would not affect the foreach inside ABremoveDups.

The most likely explanation is because listOfEmailIds is not a list in your case...

If I do:

listOfEmailIds=list("adb@xyz.com" "qrs@xyz.com" "adb@xyz.com" "pope@vatican.org"
"qrs@xyz.com")
emailAddresses=buildString(ABremoveDups(listOfEmailIds) ",")

I get emailAddresses as: "pope@vatican.org,qrs@xyz.com,adb@xyz.com"

Regards,

Andrew.
 
Hello Andrew,

Thanks for your reply,
Regarding removing dupilcates
I am getting an error as -
*Error* foreach: second argument must be a list
May be this could be because the return value of buildString is not a
list


emailAddresses=buildString(ABremoveDups(listOfEmailIds) ",")
for the above statement I have checked listp(emailAddresses) the
answer is nil.
How can I resolve this problem Andrew.

Regards,
Sridhar.
 
Hi Andrew,
Yes , this is correct the list of id's in my case is not a list.
it is some thing like
a="abc.com,abc.com,xyz.com"
I have used
temp=parseString(a ",")
to get
("abc.com""abc.com"xyz.com")
And then I used
emailAddresses=buildString(removeDups(temp) ",")

Thanks once again andrew ,

Regards,
Sridhar.
 
Hello Andrrew,

I have got one more issue
I have
a = "qwe,wer,ert,rty"
Now I want to modify it as

qwe
wer
ert
rty

How can I do this.

But in my script I am using hiDisplayAppDBox( ) function to display
this So I have inserted \n using rexcomile and rexreplace in the place
of "," and it worked there but how can I do this directly.

Regards,
Sridhar.
 
sridhartv25@gmail.com wrote, on 06/03/09 10:56:
Hello Andrrew,

I have got one more issue
I have
a = "qwe,wer,ert,rty"
Now I want to modify it as

qwe
wer
ert
rty

How can I do this.

But in my script I am using hiDisplayAppDBox( ) function to display
this So I have inserted \n using rexcomile and rexreplace in the place
of "," and it worked there but how can I do this directly.

Regards,
Sridhar.
rexCompile and rexReplace is a reasonable solution. Or you could use:

buildString(parseString(a ",") "\n")

Regards,

Andrew.
 

Welcome to EDABoard.com

Sponsor

Back
Top