Sponsored Content
Top Forums Shell Programming and Scripting asked question about script before missed ansewr.. Post 55179 by moxxx68 on Sunday 5th of September 2004 01:30:38 PM
Old 09-05-2004
Computer scripts

Smilie
this may look easy.. infact the first time I tried it last year right when i first started to use linux it worked.. on one of the linux systems that I have had.. I have had 4 systems include this one 3 old laptops to expriment with an o.k desktop and now a new HP pavillion laptop finally to work on bigger things.. but after trying the programm the first time, the second and third time i got confused.
# ! /bin/sh
# .filename

script 1
function print () { clear; pwd; date; tty; }
`tty`="TTY"
if [ $TTY = "/dev/pts/3 ]
then
print
echo "experimental terminal"
else
print
fi


script 2 (of several )

{ clear; pwd; date; tty; `tty`="TTY" | awk '{if($0 == /dev/pts/3)print "experimental terminal"}; }

or

function print () { clear; pwd; date; tty; }
if ($PWD == such and such dir)
then
print
echo " experimental terminal" >/dev/pts/3
else
print'
fi
SmilieSmilie

Last edited by moxxx68; 09-05-2004 at 03:03 PM..
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Simple Question ever asked

How do I cahnge my plan under my profile? (5 Replies)
Discussion started by: D3adRabbit
5 Replies

2. Shell Programming and Scripting

I thought I asked the question before but I haven't sorry

:D could any one answer my previous question... just looked through logg and found no such question that I had asked.. please any input would help \.. :confused: (2 Replies)
Discussion started by: moxxx68
2 Replies

3. HP-UX

vgchgid missed one disk

Hi, Suppose I have 3 disks c0t0d0, c0t0d1, and c0t0d2 all with the *same* VGID. I then run: # vgchgid /dev/rdsk/c0t0d0 /dev/rdsk/c0t0d1 (notice I *accidentally* skipped the third disk!) How would I fix this so that all 3 disks have the same VGID again? I'm looking for step-by-step... (7 Replies)
Discussion started by: apra143
7 Replies

4. AIX

Career Advice Asked

Dear All i am working on windows plattform and i am interested in Aix so i have done IBM Aix certification, can you please suggest Aix filed is good for my carrier,currently i am working as Desktop admin edit by bakunin: please understand that the question you raised has nothing to do with the... (1 Reply)
Discussion started by: manzur13
1 Replies

5. Shell Programming and Scripting

variable not getting asked....

Hello all, I am trying to pass or trying to get a variable assinged...but seemed like i am doing something wrong here.... so lets say abc.txt(spool the output out) is my file, where i am doing select * Fro mv$version inside my DB and getting some info. -/home/oracle/logs >cat abc.txt SQL>... (1 Reply)
Discussion started by: abdul.irfan2
1 Replies

6. Linux

Apache folder missed

Hi, I am confused on apache service. Please advice me There is no apache directory in my linux box. Even I cant find out httpd.conf file also. But If browse my Hostname in Internet Explor, I can able to apache service there. Please How it is working .. This file is available in... (1 Reply)
Discussion started by: Mani_apr08
1 Replies

7. Shell Programming and Scripting

Find missed numbers

I have a file as follows: 1 3 7 12 78 ... 999998 1000000 I want to find out all numbers not in the file above and put into another file like 2 4 5 6 8 9 10 (13 Replies)
Discussion started by: dtdt
13 Replies

8. UNIX for Beginners Questions & Answers

Can I trace who asked for reboot

Hi, I have an unexpected reboot happening on a Debian 9.9 server. Yesterday 2019-12-01 at 8:30:34 a reboot happened without me or my team being aware: /var/log/syslog:Dec 1 08:30:34 xxxx shutdown: shutting down for system reboot /var/log/syslog:Dec 1 08:30:34 xxxx init: Switching to... (4 Replies)
Discussion started by: chebarbudo
4 Replies
All times are GMT -4. The time now is 05:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy