当前位置:网站首页>shell 上移目录
shell 上移目录
2022-06-09 01:18:00 【ghostwritten】
shell 上移目录
up.sh
#!/bin/bash
LEVEL=$1
for ((i = 0; i < LEVEL; i++)); do
echo $i
CDIR=../$CDIR
done
cd $CDIR
echo "You are in: "$PWD
sh=$(which $SHELL)
exec $sh
执行:
[email protected]:~/shell/shell-docs/scripts# pwd
/root/shell/shell-docs/scripts
[email protected]:~/shell/shell-docs/scripts# bash up.sh
You are in: /root
[email protected]:~#
[email protected]:~/shell/shell-docs/scripts# bash up.sh 1
0
You are in: /root/shell/shell-docs
[email protected]:~/shell/shell-docs/scripts# bash up.sh 2
0
1
You are in: /root/shell
边栏推荐
- Tencent cloud applies for free SSL certificate
- [niuke.com SQL] SQL must know and know
- Simple implementation of LinkedList underlying source code (common methods)
- Introduction to opencv video processing
- Optimization practice part - udaf batch calling external requests (02)
- Graduation project: face recognition project
- 2022dasctf APR x fat epidemic prevention challenge warmup PHP
- Assembly language integrated development environment learning notes
- shell 大写转小写
- An analysis of SQL query optimization principle: 900w+ data, from 17s to 300ms
猜你喜欢

前迪士尼高管称德普将回归《加勒比海盗》 继续演船长

iscc-2022

Mongodb usage details_ 4_ Details of common aggregation operations

Goeasy applet instant messaging source v1.1.0/ based on websocket communication service provided by goeasy

Happy birthday to a Jing

一次SQL查询优化原理分析:900W+数据,从17s到300ms
![[JS] pseudo array to array](/img/01/b4f6e30f2323c2af3010349229a0f8.png)
[JS] pseudo array to array

A sharp tool to expose data inconsistency -- a real-time verification system

Are there one or two or four ways to implement multithreading?

Apple Announces Winner of the 2022 Apple Design Award
随机推荐
A sharp tool to expose data inconsistency -- a real-time verification system
一次SQL查询优化原理分析:900W+数据,从17s到300ms
How Oracle modifies the listening port - stand alone
La base théorique de l'audio et de la vidéo et les données de recherche de la technologie sous - jacente
ABViewer布局检测器功能以及性能改进
Happy birthday to a Jing
简单实现ArrayList底层(仅常用方法,注释详细)
Hu Jie: how to stabilize the usdd
A collection of commonly used SQL scripts is recommended!
Installation and deployment of LNMP
Predicate pushdown of Presto RBO
Application practice | real time data warehouse construction of Wuyi Yuntong based on Apache Doris
GO语言运算符
Graduation project: face recognition project
How to determine whether redis has performance problems and solutions -- the road to building a dream
Notes on supporting geo data mining live broadcast of Shengxin skill tree
Optimization practice part - udaf batch calling external requests (02)
USDD重磅升级,成Web3.0价值之锚
Renewal certificate of kubernetes kubeadm Management Certificate
【饭谈】自研测速平台 or 网上平台二次开发