[plug] script
John Summerfield
summer at os2.ami.com.au
Sun Oct 4 08:26:21 WST 1998
On Fri, 2 Oct 1998, Shackleton, Kevin wrote:
> I have just written this script
>
> umount /mnt/cdrom
> eject
> echo Change CD, press Enter to continue . .
> read
> mount /mnt/cdrom
>
> After discovering I had to chmod it to make it executable, I was able to
> run it.
:-)
> However it does not echo the prompt. Why is that? Does this
> script not take over the console while it runs?
This works here:
[summer at possum summer]$ cat bin/test
#!/bin/sh -x
echo Change CD, press Enter to continue . .
read
echo ta
[summer at possum summer]$ bin/test
+ echo Change CD, press Enter to continue . .
Change CD, press Enter to continue . .
+ read
+ echo ta
ta
[summer at possum summer]$
However, in this particular case, why not use autfs? Devices mounted
with autofs are automatically unmounted if not used for a while, mounted on
demand. See this example:
[summer at possum summer]$ ls /os2
total 1
drwxr-xr-x 2 root root 0 Oct 3 19:59 .
drwxr-xr-x 23 root root 1024 Sep 24 22:46 ..
[summer at possum summer]$ ls /os2/c | head
total 6274
drwxr-xr-x 66 root root 8192 Apr 3 1998 .
drwxr-xr-x 3 root root 0 Oct 3 19:59 ..
drwxr-xr-x 3 root root 2048 Apr 3 1998 acrobat3
-rw-r--r-- 1 root root 34092 Dec 16 1994 aic7870.add
drwxr-xr-x 2 root root 43008 Apr 3 1998 archive
-rw-r--r-- 1 root root 143 Feb 10 1998 autoexec.000
-rw-r--r-- 1 root root 265 Aug 25 03:14 autoexec.bat
-rw-r--r-- 1 root root 36 Apr 1 1998 b.cmd
drwxr-xr-x 2 root root 2048 Apr 29 01:04 books
Broken pipe
[summer at possum summer]$ ls /os2
total 9
drwxr-xr-x 3 root root 0 Oct 3 19:59 .
drwxr-xr-x 23 root root 1024 Sep 24 22:46 ..
drwxr-xr-x 66 root root 8192 Apr 3 1998 c
[summer at possum summer]$
Cheers
John Summerfield
http://os2.ami.com.au/os2/ for OS/2 support.
Configuration, networking, combined IBM ftpsites index.
More information about the plug
mailing list