Yea, I ruled out using the IP Address because of that reason (*DHCP) and also that other users could be logged in remotely as well... Not sure what version that has been deprecated on but the remote PC is running OpenSuSE 13.1 Kernel 3.14... so its fairly newer I suppose...
But anyway, I think the "who am i" command should help me do what I want. I was thinking of something like this below. This is just a simple test, but it seems to have worked:
After SSH'ing in I ran this file and it printed "TRUE", then I physically went to this machine and ran this file and it printed "FALSE". So I think it should work.
And I know the REGEX isn't very precise in terms of fitting into what the standards of what an IP Address can be (*i.e. the regex allows numbers higher then 255) but for my purposes I think this should suffice...
how can i process jobs parallel with conditions below.
Script1.ksh
Script2.ksh
Script3.ksh
Script4.ksh
Script5.ksh
Script6.ksh
Script7.ksh
Script8.ksh
Script9.ksh
Script10.ksh
After successful completion of Script1.ksh I need to run Script7.ksh.
After successful... (4 Replies)
Below is my shell script. I am trying to execute two different BTEQ scripts depending on the day of the week. So on a saturday I will execute a certain BTEQ script and on other weekdays I will run the other script.
#!/bin/ksh
dt=`date +"%a"`
if then
bteq > final_output <<- EOF
.run... (3 Replies)
I need a shell script that will monitor a few conditions and not execute until the these conditions are met. The problem I'm having is that I can not perform a database snapshot (backup) of a sybaseIQ database unless the CPU Status Idle % is above 60% or the snapshot (backup) fails.
If... (2 Replies)
Hi All,
I want to echo a message in case a system is reachable by ping or echo a different message in case it's not reachable.
Sample code i wrote is
ping localhost -n 2 | grep 'ttl' > ping_op; ls ping_op > /dev/null && drReachable=Alive; echo -e `date`: \\t "DR server is reachable" >>... (5 Replies)
Hi ,
I have a script which has multiple awk and sed commands like below.
First one :-
find /root/src/ -name "*csv" -size 0 -exec rm {} \;
Second one: -
ls *SRE*.txt > SRT_TRAN.dat
rm *asr*.txt
Third one :-
find /root/src/ -name '*.csv' | while read FILENAME ;
do
awk... (2 Replies)
Hi,
I have a list of files with different filenames like nam0001.txt,pan0001.txt etc coming in /data/inbox from various places.
I needed a shell script which would:-
1)searches for a word from the filenames (coming in inbox directory) provided in input parameter.
2)if found, put in... (2 Replies)
Let me give you a complete example what I am trying to achieve.
1. Below is the log file structure where I need 2,5 and 14th column of the logs after grepping through the linkId=1ddoic.
Log file structure:-
abc.com 20120829001415 127.0.0.1 app none11111 sas 0 0 N clk Mozilla/5.0... (3 Replies)
I have a unix shell script Test.sh
more Test.sh
echo "Calling dbquery1.sh...."
./dbquery1.sh
echo "Calling dbquery2.sh...."
./dbquery2.sh
more dbquery1.sh
sqlplus -s user1/password1@DB_SID @/tmp/storedprocedures/Hello.rcp
I run Test.sh
However, I do not want dbquery2.sh to be... (3 Replies)
for file in File_Name*
do
ed -s $file << 'EOF'
0a
$Header_Record
.
$a
.
w
EOF
done
The above command is executing in the unix box but is not... (2 Replies)
Here's an interesting (to me, anyway) little puzzle.
Background:
I have a process that restores a number of large(ish) files from tape backup. As an individual file is being written, it is owned by root, then the ownership is changed when that file is complete. Since this process can take... (3 Replies)
Discussion started by: edstevens
3 Replies
LEARN ABOUT FREEBSD
rusers
RUSERS(1) BSD General Commands Manual RUSERS(1)NAME
rusers -- who is logged in to machines on local network
SYNOPSIS
rusers [-al] [host ...]
DESCRIPTION
The rusers command produces output similar to who(1), but for the list of hosts or all machines on the local network. For each host respond-
ing to the rusers query, the hostname with the names of the users currently logged on is printed on each line. The rusers command will wait
for one minute to catch late responders.
The following options are available:
-a Print all machines responding even if no one is currently logged in.
-l Print a long format listing. This includes the user name, host name, tty that the user is logged in to, the date and time the user
logged in, the amount of time since the user typed on the keyboard, and the remote host they logged in from (if applicable).
DIAGNOSTICS
rusers: RPC: Program not registered The rpc.rusersd(8) daemon has not been started on the remote host.
rusers: RPC: Timed out A communication error occurred. Either the network is excessively congested, or the rpc.rusersd(8) daemon has termi-
nated on the remote host.
rusers: RPC: Port mapper failure - RPC: Timed out The remote host is not running the portmapper (see rpcbind(8)), and cannot accommodate any
RPC-based services. The host may be down.
SEE ALSO rwho(1), users(1), who(1), rpc.rusersd(8), rpcbind(8)HISTORY
The rusers command appeared in Sun-OS.
BUGS
The sorting options are not implemented.
BSD April 23, 1991 BSD