sd -- a drop-in replacement for `cd'

Check-in [652cbec2de]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:tidy up continued.
Timelines: family | ancestors | descendants | both | mksh
Files: files | file ages | folders
SHA1: 652cbec2dea8dc3f5bd76077490edf836ff8cefe
User & Date: vdh 2019-12-22 17:11:36
Context
2019-12-28 11:01
ensure sane input to `sdman'. remove (apparently redundant) use of `eval'. Leaf check-in: ed15a9ba9f user: vdh tags: mksh
2019-12-22 17:13
take over the tidy up from mksh branch. check-in: a28d3150c6 user: vdh tags: ksh
2019-12-22 17:11
tidy up continued. check-in: 652cbec2de user: vdh tags: mksh
2019-12-22 17:10
tidy up continued. check-in: cf34cbb665 user: vdh tags: mksh
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Deleted sdirs.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
#
# name: sdirs
# depends: sd.ksh
#
#provide the `sdirs' function from `sd.ksh' as a standalone executable.
#only needed when using `tcsh'.
#
sdlines=512
sdmax=8192
sdselect=0

sdistcsh=1
. sd.ksh

((sdselect == 0)) && { sdirs $*; exit; }

dname=$(sdirs $*)

#note that we use `chdir' instead of `cd' in order to prevent
#recursion when defining the tcsh alias for `cd'.
#tcsh crashes during eval if the `cd' is not successful, so we test again.
if [[ -d "$dname" ]]; then
   (sd "$dname" > /dev/null 2> /dev/null; sdlogappend)
   echo "chdir \"$dname\""
elif [[ $dname == "-" ]]; then 
   echo chdir $dname
else
   echo "echo $*: no such directory."
fi

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<