All xCAT commands linked to 'xcatDBcmds' (mkdef for example) read standard
input in an of these 3 cases:
1. on linux and using a *ksh shell
2. term is not defined
3. stdin is a pipe

To better illustrate (using the `if` conditional from xcatDBcmds:)

[samveen@xcatmn1 scripts]$ set |egrep 'SHELL=|TERM='

SHELL=/bin/bash

TERM=screen

[samveen@xcatmn1 scripts]$ perl -e 'if ( (($^O =~ /^linux/i) &&
($ENV{'SHELL'} =~ /\/ksh$/))  || !defined($ENV{'TERM'}) ) { print "true\n"
};'

[samveen@xcatmn1 scripts]$ (SHELL=/bin/ksh;  perl -e 'if ( (($^O =~
/^linux/i) && ($ENV{'SHELL'} =~ /\/ksh$/))  || !defined($ENV{'TERM'}) ) {
print "true\n" };')

true

[samveen@xcatmn1 scripts]$ (unset TERM;  perl -e 'if ( (($^O =~ /^linux/i)
&& ($ENV{'SHELL'} =~ /\/ksh$/))  || !defined($ENV{'TERM'}) ) { print
"true\n" };')

true

As your environment doesn't match any of these conditions when you do input
redirection, so no luck for you. Try one of the workarounds (a subshell
with `unset TERM` preferably) to get your desired behaviour

On Fri, Oct 16, 2015 at 12:00 PM, Chris Samuel <[email protected]>
wrote:

> Hi folks,
>
> I've noticed this for ages, but showing a new starter here about
> creating a new definition made me decide to flag this up as a puzzling
> oddity with mkdef.
>
> mkdef -z doesn't like input that is redirected from a file:
>
> [root@snowy-m tmp]# mkdef -z < rhel67_gpfs35027
> Error: No object names were provided.
>
> However, using cat to send that over a pipe is fine:
>
> [root@snowy-m tmp]# cat rhel67_gpfs35027 | mkdef -z
> 1 object definitions have been created or modified.
>
>
> Any ideas?
>
> cheers,
> Chris
> --
>  Christopher Samuel        Senior Systems Administrator
>  VLSCI - Victorian Life Sciences Computation Initiative
>  Email: [email protected] Phone: +61 (0)3 903 55545
>  http://www.vlsci.org.au/      http://twitter.com/vlsci
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> xCAT-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/xcat-user
>



-- 
--
Samveen S. Gulati
http://samveen.in

The best-laid schemes o' mice an 'men
Gang aft agley,
An'lea'e us nought but grief an' pain,
For promis'd joy!
-- Robert Burns
(The best laid plans of mice and men often go awry,
and bring nothing but grief and pain instead of ..)
------------------------------------------------------------------------------
_______________________________________________
xCAT-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xcat-user

Reply via email to