I took a quick peek at the script but it's a bit too 'weird' for my liking to actually dive into this. Even so, as to the original question, the
tcsh(1) manualpage is your friend here. However, the solution may not be this simple.
To set those three environment variables you'd use the
setenv command. So instead of the lines used you could use something in the likes of this:
Code:
setenv user ${USER}
setenv path ${PATH}
setenv home ${HOME}
But you're not done here. The script also needs to be changed at the places where it's actually using these newly set variables. For example:
Code:
set lastlog [exec -- lastlog -u $var(user)]
This actually provides us with multiple problems, and it also clearly shows why setting this up may be a completely fruitless effort. For starters; FreeBSD doesn't know the
lastlog command, that's a specific command for Linux environments; it shows the last entries from the
/var/log/lastlog file. Of course we could try using
last(1) instead but I have no idea if that'll provide the required results.
Another reason why this won't work too well; not only is
$var unknown,
tcsh doesn't use those brackets for command substitution. So this would require a complete change, something like:
Code:
setenv lastlog `last ${user}`
But that of course leads up to yet another new problem:
Code:
set ll(1) [lindex $lastlog 7]
set ll(2) [lindex $lastlog 8]
set ll(3) [lindex $lastlog 9]
set ll(4) [lindex $lastlog 10]
set ll(5) [lindex $lastlog 6]
My suggestion would be to quit while you're ahead. This script is too specific to be easily used, not only specific to a particular shell (one which I'm unfamiliar with) but also to the Linux environment. Considering it's functionality I'd consider it a better idea to simply write a script yourself.