In the last section we saw some examples of how the SCR can be used from YCP. However if you only want to test or explore different SCR-paths, writing a YCP-script for every access can be cumbersome. Fortunately the SCR-component can be run individually on the command line of a terminal using a method very similar to the one we saw in Chapter 4, Running y2base Stand-Alone.
In contrast to the method demonstrated there, this time we don't feed a YCP-script into YaST. Instead we make another use of the architectural separation of components featured by YaST in that we connect the so-called stdio-component with the SCR-component. By doing so we can feed everything we type on the command line into the SCR.
However, because of the “raw” nature of the YaST-internal communication paths, this method is not very comfortable. You can't correct typos with Backspace or Del here (the SCR is not meant to be operated in this way). By doing so we kind of “simulate” YaST-internal communication which normally forecloses any misspelling.
Furthermore, if you play around with the SCR in this manner you will be able to initiate privileged actions only if you are running the commands under the root-account.
![]() | Caution |
---|---|
If you run “manual” SCR-commands under the root-account, the SCR will “gracefully” fulfill all your wishes. So be careful with Write and Execute!!! |
Now operating the SCR this way can be shown best with some examples.
Example 5.1. Operating the SCR from the command line
$> /usr/lib/YaST2/bin/y2base stdio scr ([]) Read(.probe.boot_arch) ("grub") Read(.probe.version) ("Oct 7 2002, 15:05:08") Read(.probe.has_smp) (false) Read(.probe.has_apm) (true) SCR::Read(.probe.boot_arch) (nil) |
As is shown above, the command y2base stdio scr starts YaST in a specific way. It connects the YaST client-component stdio with the server-component scr. After that the SCR is running and awaits any input on stdio which in this case is the console. To explore the content of the SCR-tree you can now enter any SCR-commands just as you would do in YCP. The only difference is the abscence of the SCR:: name space identifier which must not be given here as can be seen in the last line.