Hi, I've got 2 problems with sh:
1) I have a list of logins, seperated by a space (in a logins.txt file, like so: login1 login2 login3). I'd like to display those login names which are online AND on that list. So I made a list of those online:
users > online.txt
and now how to compare the two files and display those logins which are on both lists? I tried with diff and cmp, but failed :/
Perhaps there is an easier way to do that, now making the 2nd file?
2) I'd like to have a script that as an argument takes a file name and shows it's conent with "more" if thats a normal file, "ls" if thats a directory or a message like "that neither file nor dir" it it is neither of them. How to do that?
All help appreciated