[comp.unix.internals] Received:

news@adm.BRL.MIL (The News System <news>) (09/07/90)

Via:        UK.AC.DL.DLGM;  7 SEP 90  8:39:53 BST
Via:        UK.AC.DARESBURY.CXA;  Fri, 7 Sep 90 08:39 GMT
            (V40 at UK.AC.DARESBURY.DLGM
From:       Bill Purvis <wh%cxa.dl.ac.uk@pucc.princeton.edu>
Date:       Fri, 7 Sep 90 08:38:10 +0100
Message-Id: <14310.9009070738@uk.ac.dl.cxa>
To:         unix-wizards%arpa.brl%earn-relay@dlgm.dl.ac.uk
Subject:    re: changing root passwd

We run ATT System 5 R 3.2 and have had the same problem - the `official'
procedure is:
1)	Boot the system using the (first) distribution floppy disk.
2)	When it asks if you are ready to install Unix, break out by
	typing Ctrl-\ (The ATT manual says Ctrl-Break but its wrong!).
3)	Run fsck:
	# /tec/fsck /dev/dsk/0s1
4)	Mount 0s1 (hard disk root partition)
	# /etc/mount /dev/dsk/0s1 /mnt
5)	You can then edit the passwd file using `ed'
	# ed /mnt/etc/passwd
	Don't try anything subtle here, all you need is to delete
	the `x' on the first line.
6)	Unmount the hard disk
	/etc/umount /dev/dsk/0s1
7)	Remove floppy disk and reboot.

Its a bit fidddly to do, especially when the distribution floppy has
so little of unix on it. It doesn't have `ls' even !. It can be done if
you're reasonably careful.
	Have fun!!

Bill Purvis	System Administrator
Daresbury Lab
Warrington, Cheshire, England.

rjc@devo.unify.com (Ronald Cole) (09/08/90)

In article <24418@adm.BRL.MIL> news@adm.BRL.MIL (The News System <news>) writes:
   [ description of how to break root with the dist. floppy deleted ]
   Its a bit fidddly to do, especially when the distribution floppy has
   so little of unix on it. It doesn't have `ls' even !. It can be done if
   you're reasonably careful.
	   Have fun!!

   Bill Purvis	System Administrator
   Daresbury Lab
   Warrington, Cheshire, England.

Who needs 'ls' when you have 'echo *'?  Think creatively, this is UNIX!  ;^}

--
Ronald Cole           +----------------------+  internet: rjc@unify.com
Software Engineer II  | This space for rent. |  uucp:     uunet!unify!rjc
Unify Corporation     +----------------------+  voice:    +1 916 920 1830 x734
 "Relax. What is mind? No matter. What is matter? Never mind!" - Homer Simpson
--
Ronald Cole           +----------------------+  internet: rjc@unify.com
Software Engineer II  | This space for rent. |  uucp:     uunet!unify!rjc
Unify Corporation     +----------------------+  voice:    +1 916 920 1830 x734
 "Relax. What is mind? No matter. What is matter? Never mind!" - Homer Simpson

peter@ficc.ferranti.com (Peter da Silva) (09/08/90)

In article <RJC.90Sep7100750@devo.unify.com> rjc@devo.unify.com (Ronald Cole) writes:
> Who needs 'ls' when you have 'echo *'?  Think creatively, this is UNIX!  ;^}

ls()
{
	for i
	do
		echo $i
	done
}
-- 
Peter da Silva.   `-_-'
+1 713 274 5180.   'U`
peter@ferranti.com

chet@cwns1.CWRU.EDU (Chet Ramey) (09/09/90)

Peter da Silva writes:

$ ls()
$ {
$ 	for i
$ 	do
$ 		echo $i
$ 	done
$ }

Useful, that.

cwns1$ unalias ls
cwns1$ ls()
> {
> 	for i
> 	do
> 		echo $i
> 	done
> }
cwns1$ ls /notthere
/notthere
cwns1$ /bin/ls /notthere
/notthere not found

Creative use of `[ -f $i -o -d $i ]' is needed, I think.

Chet
-- 
Chet Ramey				``Levi Stubbs' tears run down
Network Services Group			  his face...''
Case Western Reserve University	
chet@ins.CWRU.Edu		

peter@ficc.ferranti.com (Peter da Silva) (09/09/90)

In article <1990Sep9.004235.11572@usenet.ins.cwru.edu> chet@po.CWRU.Edu writes:
> Peter da Silva writes:
> $ ls()
> $ {
> $ 	for i
> $ 	do
> $ 		echo $i
> $ 	done
> $ }

> Useful, that.

When hacking around on a floppy-booted UNIX system, yes.

> Creative use of `[ -f $i -o -d $i ]' is needed, I think.

Well, it might be desirable, but anyone screwing with the UNIX on their
boot floppy is probably up to noticing the difference. But, if you insist:

# Anal-retentive ls() for boot floppies... dare to type it in!
#
# UNTESTED!!!!!
#
ls()
{
  RECURSE=-d
  TYPE=0
  DIR=0
  for i
  do
    case ".$i" in
      .-F) TYPE=1;;
      .-R) RECURSE=;;
      .-d) DIR=1;;
      .-*) echo "Option $i not implemented.";;
      *)
        if [ -f $i -o -d $i ]
	then
	  if [ $TYPE = 1 -a -x $i ]
	  then
	    echo "$i*"
	  elif [ $TYPE = 1 -a $DIR = 1 -a -d $i ]
	  then
	    echo "$i/"
	  elif [ $DIR = 0 -a -d $i ]
	  then
	    DIRS="$DIRS $i"
	  else
	    echo "$i"
	  fi
	else
	  echo "$i not found"
	fi
	;;
    esac
  done
  for i in $DIRS
  do
    echo "\n$i:"
    ls $RECURSE $i
  done
}
-- 
Peter da Silva.   `-_-'
+1 713 274 5180.   'U`
peter@ferranti.com

chet@cwns1.CWRU.EDU (Chet Ramey) (09/10/90)

$ $  $ ls()
$ $  > {
$ $  > for i
$ $  > do
$ $  > 		echo $i
$ $  > done
$ $  > }
$ 
$ $  Useful, that.

$ When hacking around on a floppy-booted UNIX system, yes.

Oh, really?  You've already got `echo' as a shell built-in, why write a
function with a different name to duplicate its functionality? 

Chet
-- 
Chet Ramey				``Levi Stubbs' tears run down
Network Services Group			  his face...''
Case Western Reserve University	
chet@ins.CWRU.Edu