I have this problem using the command ‘last’. My task is to find names of people, that have been logged in at night hours (22:00 - 5:00). So I’ve tried to save the first number (22) to a variable and wanted to compare, but it doesn’t work at all.
This is how it looks like.
@ a = `last | cut -c 55-56 `
And I’ve also tried this:
@ a = `last | tr -s “ “ “ “ | cut -d “ “ -f7 | cut -d “:” -f1 `
But none of this worked it always says “Ambiguous” and I really don’t know what I’m doing wrong. I’m new in this and I would be very thankful if somebody helped me. Thank you.
"normal"
quotes? – Jeff Schaller Oct 25 '17 at 09:58