[Casper] Scripting help
Ryan Harter
rharter at uwsp.edu
Fri Nov 7 07:44:17 PST 2008
You have escaping problems here. In bash (and sh) '\' is reserved for
escaping characters. If you want to put "quotes inside another set of
quotes, you have to \"escape\" them with '\'". Right now you are
escaping 'd' (with \d), etc. If you want to put those backslashes in,
you need to also escape them. That can be done by just replacing them
with \\ .
A good way to test your string escaping is to just echo it for
testing. Test this string with:
echo "NA\domain admins,NA\enterprise admins,NA\bby-r-
corpworkstationadmin-wk-f,NA\bby-r-MacAdminUsers-WK-F"
and I think it will return
NAomain admins,NAnterprise admins,NAby-r-corpworkstationadmin-wk-
f,NAby-r-MacAdminUsers-WK-F
Note that double quotes doesn't solve this, single quotes might, but
you should really double them up. Check out this part of the ABS for
more info: http://tldp.org/LDP/abs/html/escapingsection.html
Ryan Harter
UW - Stevens Point
Workstation Developer
715.346.2716
Ryan.Harter at uwsp.edu
On Nov 7, 2008, at 9:32 AM, Cyrus Vahhaji wrote:
> Questions for scripting experts. I’m trying to run this as a script
> and for some reason its not running. Here is what I’ve scripted.
>
>
> #!/bin/sh
>
> dsconfigad -groups "NA\domain admins,NA\enterprise admins,NA\bby-r-
> corpworkstationadmin-wk-f,NA\bby-r-MacAdminUsers-WK-F"
>
> Does anything jump out that prevents this from running? After
> running the script using Casper the log says it can’t be found which
> I’m guessing there is a syntax error somewhere?
>
> Thanx,
> Cyrus
> <ATT00001.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.jamfsoftware.com/pipermail/casper/attachments/20081107/a746f815/attachment.html
More information about the Casper
mailing list