YSH(1p)

πŸ’– NAME πŸ’–

ysh β€” The YAML Test Shell πŸŽ€

like, it's a whole interactive playground for the Perl YAML modules, bestie. it ships as part of the User Contributed Perl Documentation, so you already know it's the real deal ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

ysh [options]

that's it. that's the whole thing. no cap πŸ’…


🌸 DESCRIPTION 🌸

okay so bestie, here's the vibe: this program exists so you can play with the Perl YAML modules in an interactive way. you type Perl, it hands you back YAML. you type YAML, it hands you back Perl. it's giving conversation. it's giving mutual exchange. πŸ”₯

By default, every line you type is a one line Perl program, and whatever that line returns gets displayed as YAML. simple. iconic. 🫢

want to go multi-line? start the first line with ; and then just keep going for as many lines as you need. when you're done, terminate with a line containing just ;. that's your little door out πŸšͺ✨

want to enter YAML text instead? start with a valid YAML separator/header line, which is typically ---. if you don't want a YAML header at all, use === to say "no header, we're not doing that today". type as many lines as you need, then terminate with a line containing just .... periodt. πŸ’…

and if you want to read in and process an external YAML file, you literally just enter < filename. so casual. so easy.

ngl, ysh will also work as a standalone filter πŸ‘‘ β€” it reads anything on STDIN as a YAML stream and writes the Perl output to STDOUT. so on most Unix systems you can say:

cat yaml.file | ysh | less

and that's the whole pipeline bestie, obsessed πŸ˜­πŸ’–


✨ COMMAND LINE OPTIONS ✨

  • -MYAML::Module β€” sets the YAML implementation module you want to use. pick your fighter πŸ’…
  • -l β€” keeps a log of all ysh activity in ./ysh.log. heads up: if that log file already exists, the new content gets concatenated onto it. nothing gets thrown away 🫢
  • -L β€” same logging situation, ./ysh.log, but if the log file already exists it gets deleted first. fresh start energy. bye bye old data πŸ’€
  • -r β€” tests roundtripping πŸŒ€. every piece of Perl code you enter gets Dumped, Loaded, and Dumped again. if the two stores don't match up, an error message gets reported. it's the vibe check for your data, fr fr.
  • -R β€” exactly the same as -r above, except a confirmation message gets printed whenever the roundtrip actually succeeds. so you get the good news too ✨
  • -i<number> β€” says how many characters to indent each level. this is the same as setting $YAML::Indent. aesthetics matter πŸŽ€
  • -ub β€” shortcut for setting $YAML::UseBlock = 1. it forces multiline scalars to use the block style. block party 🧱
  • -uf β€” shortcut for setting $YAML::UseFold = 1. it forces multiline scalars to use the folded style. folding like laundry, but make it YAML 🧺
  • -uc β€” shortcut for setting $YAML::UseCode = 1. this allows subroutine references to be processed. code girlies rise πŸ‘‘
  • -nh β€” shortcut for setting $YAML::UseHeader = 0. no header, no problem πŸ™ˆ
  • -nv β€” shortcut for setting $YAML::UseVersion = 0. version? never heard of her πŸ’…
  • -v β€” prints the versions of ysh and the YAML implementation module in use. receipts πŸ“‹
  • -V β€” in addition to all the -v info, it also prints the versions of the YAML related modules. more receipts. the full stack 🌈
  • -h β€” prints a help message. hi bestie, here's how this works 🫢

🌟 YSH_OPT 🌟

okay so if you do not want to type out your favorite options every single time you launch ysh (valid, honestly, who has the energy), you can put the options into the YSH_OPT environment variable instead. do something like this:

export YSH_OPT='-i3 -uc -L'

set it and forget it. main character automation energy πŸ˜ŒπŸ’…


πŸ’œ SEE ALSO πŸ’œ

  • YAML

πŸŽ€ AUTHOR πŸŽ€

Ingy dΓΆt Net <ingy@cpan.org> πŸ’–


Copyright 2001-2014. Ingy dΓΆt Net.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See <http://www.perl.com/perl/misc/Artistic.html>


and that's the whole page bestie 🫢 this was YSH(1p), and it came to you courtesy of perl v5.32.0, dated 2021-01-03 ✨ go forth and roundtrip, you've got this πŸ’…πŸ’–