That's a good idea, but I wanted something more real-time, so I came up with a hack. If I put this in both ~/.kshrc and /root/.kshrc, I get what I want:
Unlike bash, ksh does not have the handy PROMPT_COMMAND. However, the PS1 variable does support command substitution, which my hack exploits. As long as both user's and root's history files have write permission for "others", now whenever root runs a command that command gets appended to my regular user's history, and vice-versa.
Last edited by DevuanFan; 12-27-2018 at 02:21 PM..
Hello,
How do I write a korn shell that will rename file with the current date. What I want to do is, I have a file that is re-written every day. But instead, I want to keep a 14 day history of the file. So I want to write a script that will rename the current file with a date attached to the... (2 Replies)
Hi,
I need to access a user's command history. However, the dilemma is that he is logged in and so his current history is not yet flushed to .bash_history file which gets flushed when he logs out. Is there a way I can still access his most recent history?
thank you,
S (4 Replies)
Hi All
I have written one shell script for GPRS route add is given below named GPRSRouteSet.sh
URL="www.google.com"
VBURL="10.5.2.211"
echo "Setting route for $URL for GPRS"
URL_Address=`nslookup $URL|grep Address:|grep -v "#"|awk -F " " '{print $2}'|head -1`
echo "Executing ... (3 Replies)
Hi all,
My need is :
1. To know who , when , which command used.
2. Local user should not delete this information.
I mean , with an example , i can say
i have a user user1
i need to give all the following permissions to user1, :
a. A specific directory other than his home... (3 Replies)
Hello,
I can't seem to understand korn shell regular expression. I am trying to extract the tagfrom its own filename string.
var="LNX_1.2.0.0.af329a3da.tar"
whereby af329a3da is the tagI am trying to extract out from.
I am trying to avoid using IFS because future modifications... (5 Replies)
Hi Every body,
I would need a shell script program to login as different user and perform some copy commands in the script.
example: Supppose ora_toms is the active user
ora_toms should be able to run a script where user: ftptomsp pass: XXX should login through and run the commands
... (9 Replies)
Hi all,
My need is :
1. To know who , when , which command used.
2. Local user should not delete this information.
I mean , with an example , i can say
i have a user user1
i need to give all the following permissions to user1, :
a. A specific directory other than his home... (1 Reply)
Dear Friends,
Can Any one provide me script to generate list of username with the gecos field.
(cat /etc/passwd | cut -d: -f1,5)
Please note i have to run this command from nim server and i have password less ssh access.(ssh hostname command)
and i want a file to be generated on nim... (1 Reply)
Hi,
I need to switch from local user to root user in a shell script.
I need to make it automated so that it doesn't prompt for the root password.
I heard the su command will do that work but it prompt for the password.
and also can someone tell me whether su command spawns a new shell or... (1 Reply)
Discussion started by: Little
1 Replies
LEARN ABOUT NETBSD
chroot
CHROOT(8) BSD System Manager's Manual CHROOT(8)NAME
chroot -- change root directory
SYNOPSIS
chroot [-G group,group,...] [-g group] [-u user] newroot [command]
DESCRIPTION
The chroot command changes its root directory to the supplied directory newroot and exec's command, or, if not supplied, an interactive copy
of your shell.
If the -u, -g, or -G options are given, the user, group, and group list of the process are set to these values after the chroot has taken
place; see setgid(2), setgroups(2), setuid(2), getgrnam(3), and getpwnam(3).
Note: command or the shell are run as your real-user-id.
ENVIRONMENT
The following environment variable is referenced by chroot:
SHELL If set, the string specified by SHELL is interpreted as the name of the shell to exec. If the variable SHELL is not set, /bin/sh is
used.
SEE ALSO ldd(1), chdir(2), chroot(2), environ(7)HISTORY
The chroot utility first appeared in 4.4BSD.
SECURITY CONSIDERATIONS
chroot should never be installed setuid root, as it would then be possible to exploit the program to gain root privileges.
BSD August 13, 2011 BSD