aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorjet2tlf <jet2tlf@gmail.com>2024-05-31 04:45:18 +0000
committerjet2tlf <jet2tlf@gmail.com>2024-05-31 04:45:18 +0000
commitb2e27e73547a2a2bc26f24b5b61592d9582a5098 (patch)
tree2910b8cc25ad995ee4a2303b2c707628b928ebe9 /cmd
parentf37141ac0b2905b07f7a060852ea6a302b1fd527 (diff)
downloadshell-go-b2e27e73547a2a2bc26f24b5b61592d9582a5098.tar.gz
shell-go-b2e27e73547a2a2bc26f24b5b61592d9582a5098.zip
pass 10st stage
Diffstat (limited to 'cmd')
-rw-r--r--cmd/myshell/main.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/myshell/main.go b/cmd/myshell/main.go
index c4bb372..19242e9 100644
--- a/cmd/myshell/main.go
+++ b/cmd/myshell/main.go
@@ -45,6 +45,12 @@ func main() {
}
}
+func Cd(dir string) {
+ if err := os.Chdir(dir); err != nil {
+ fmt.Fprintf(os.Stdout, "%s: No such file or directory\n", dir)
+ }
+}
+
func Pwd() {
dir, err := os.Getwd()