Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

trey5498

macrumors regular
Original poster
Jun 16, 2008
191
0
Code:
system("lpadmin -p ARC-ATLAB-BWQ -v lpd://at-regulus.ad.ufl.edu/ARC-ATLAB-BWQ -P /Library/Printers/PPDs/Contents/Resources/HP\ LaserJet\ 4250.gz");
system("cupsenable ARC-ATLAB-BWQ");
system("accept ARC-ATLAB-BWQ");

seems to throw warnings out is there a char that I put in it (IE: Perl has the "\" to make chars that that mean something in it act literally) to make it behave correctly? All the warnings are in the first line.

I have seen something about NStask however no code example and they are not explained in my books. Is that any better and would i have something like this?:

Code:
[NSTask "lpadmin -p ARC-ATLAB-BWQ -v lpd://at-regulus.ad.ufl.edu/ARC-ATLAB-BWQ -P /Library/Printers/PPDs/Contents/Resources/HP\ LaserJet\ 4250.gz"];
 
The backslash is the escape character. You have some backslashes that you want to appear literally in the first command. Just add a second backslash before each to escape them.

-Lee
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.