Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Playing with code found on Perlmonks

by skx (Parson)
on Apr 14, 2008 at 11:53 UTC ( #680254=note: print w/replies, xml ) Need Help??

in reply to Playing with code found on Perlmonks

This could be rewritten:

fname=`echo $fname|sed 's/~/\/home\/ben/g'`


fname=`echo $fname|perl -pe "s#~#$HOME#g"`

Replies are listed 'Best First'.
Re^2: Playing with code found on Perlmonks
by oko1 (Deacon) on Apr 17, 2008 at 00:01 UTC

    Oh - I hadn't realized we were golfing. In Unix, as in Perl, TMTOWTDI.

    # Bourne shell and derivatives fname=`eval echo $fname` # Modern shells (e.g., Bash) fname=${fname/\~/$HOME}

    Your turn, m'sieu? :)

    Human history becomes more and more a race between education and catastrophe. -- HG Wells

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://680254]
[LanX]: do I need to activate JS to see Trump loosing his wig?
[LanX]: aha ...
LanX Finally, there is a certain order or choreography to the greetings, which Kornhauser-Duda appears to have been following. First, the two heads of state shake hands, while the two first ladies do the same
[LanX]: FAKE NEWS , erix, so sad! Fired!

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2018-03-22 20:14 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (286 votes). Check out past polls.