Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'The ^ is a shell character' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
The ^ is a shell character
Authored by: paco on Jul 26, '04 02:37:59PM

That's weird. I've tried in both bash and tcsh to duplicate this, and I can't.

Generally speaking, you have to use single quotes around that perl expression (i.e. '^papersize' ). If you don't, then your shell might interpret the '^' character and give you the error message that you got. If you copy and paste that command (including the single quotes), I'd be very surprised if you got an error.

In practice, you're right. The caret is actually unnecessary since "papersize" only appears once in the file and the pattern will work fine without the caret. I was just being extra cautious with the pattern.



[ Reply to This | # ]
Nope, it's definitely missing
Authored by: pmccann on Jul 26, '04 09:58:02PM

Look again at that line: there's no initial slash for the regex that you're asking perl to execute. You can leave the caret if you like, but the initial slash has to be there.

Cheers,
Paul



[ Reply to This | # ]