Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: remember perl one-liners

by tinita (Parson)
on Dec 14, 2005 at 21:22 UTC ( #516769=note: print w/replies, xml ) Need Help??


in reply to Re: remember perl one-liners
in thread remember perl one-liners

thanks for that pointer, that sounded like it could solve the problem, but i didn't...

i think the lithist option means a multiline command like:

$ for i in *.pl do echo $i done $ <arrow up> $ for i in *.pl ; do echo $i; done $ shopt -s lithist $ <arrow up> $ for i in *.pl do echo $i done
the problem appears if command arguments itself have newlines, an easy example is
$ echo " word "
so it would work if one calls perl with multiple -e args:
$ perl -wle'print 1;' \ -e 'print 2;'
but that's ugly, isn't it? =)

update: but i still think it should work because if i type in a multiline perl command and type arrow-up immediately after that i get all my lines like i typed them in. just storing in the history doesn't seem to work.

Replies are listed 'Best First'.
Re^3: remember perl one-liners
by l3v3l (Monk) on Dec 14, 2005 at 21:54 UTC
    Ahh ... makes sense - thought that would help : I tried the echo experiment with cmdhist set and it put echo into history file as one (multi-line) entry - now reading it back in ... is a whole other beast ... this does not do exactly what you require but it does allow multi-line liners to be read back in as one line: after the first $hist substitution in addhist.pl :
    $hist =~ s/\s+/ /gm;
    so I can now add (from history output):
    ... 601 perl -MYAPE::Regex::Explain -e 'print YAPE::Regex::Explain->new(qr/(aaaaa(?:(?:(?!aaaaa).)*))/s)->ex +plain' 602 addhist
    as:
    perl -MYAPE::Regex::Explain -e 'print YAPE::Regex::Explain->new(qr/(aa +aaa(?:(?:(?!aaaaa).)*))/s)->explain'
    to my ~/.oneliners file = thank you again for posting this script - I am a big fan of oneliners and this script is a big help in keeping them around longer than my histsize ...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://516769]
help
Chatterbox?
[Corion]: perldigious: That seems to be more the export and likely it's the recipients of that export that like the titles changes
[Corion]: ... "changed"
[Corion]: I usually expect fixed header names, but am sometimes lenient in the order of columns. But changing the report titles often sounds to me as if you are not the sole consument of the export ;)
[shmem]: perldigious: as always - if it ain't broke, don't fix it. Ther must be a very compelling reason for changing column names in a database. Those are rare.
[Corion]: If you have whitespace in the column names in the database, whap the DBAs ;)
[shmem]: It's common for some vendors to have column names such as WRSTVG or some other such whizzbang, and another table where these names are mapped to something meaningful depending on how you look at the data

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2017-05-25 13:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?