127
65
I think I understand the differences between an interactive, a login and a batch shell. See the following links for more help: What is the difference between a 'Login' and an 'Interactive' bash shell (from the sister site: serverfault.com) 2.1: Types of shell: interactive and login shells (from A User's Guide to the Z-Shell ) My question is, how can I test with a command/condition if I am on an interactive, a login or a batch shell? I am looking for a command or condition (that returns true or false ) and that I could also place on an if statement. For example: if [[ condition ]] echo "This is a login shell" fi
shell
share | improve this question
...
5
I am trying to create new users using useradd command using root credentials it is getting created properly but when I log in with the newly created user with its credentials using a PuTTY Console, I am able to enter the username but when I give the password, it hangs there for a long time until the PuTTY window session timeout happens and the window is closed. However when I use root credentials, it quickly enters the session. I tried checking the AllowUsers under file /etc/ssh/sshd_config but I didn't find any matching entry, so, I manually tried adding AllowUsers temipuser where temipuser is the username I created. Post making this change from another PuTTY Console I again tried entering this username but it is again the same. I am totally clueless why is this happening. Another thing is, if I add...
8
3
I want to extract a List<E> from a Map<String,List<E>> ( E is a random Class) using stream() . I want a simple one-line method using java 8's stream. What I have tried until now : HashMap<String,List<E>> map = new HashMap<>(); List<E> list = map.values(); // does not compile list = map.values().stream().collect(Collectors.toList()); // does not compile
java collections java-8 java-stream collectors
share | improve this question
edited 1 hour ago
Nicholas K
5,819 5 10 31
...