代码拉取完成,页面将自动刷新
function popd
{
mypath="/home/app2/dep_sjq/tmp/tmpfj"
current_pid=$$
parent_id=$(ps -o pid,ppid,comm | grep $current_pid | awk -v current_pid_var=$current_pid '$1==current_pid_var{print $2}')
file="$mypath/${parent_id}.dir"
if [ -f "$file" ]
then
path=`head -n 1 $file`
if [ -z "$path" ]; then
echo 'empty stack'
return;
else
cd $path
content=`sed '1d' "$file"`
echo "$content" > $file
return;
fi
else
echo 'no file'
fi
}
function pushd
{
mypath="/home/app2/dep_sjq/tmp/tmpfj"
current_pid=$$
if [ ! -d "${mypath}" ]
then
mkdir "${mypath}"
fi
parent_id=$(ps -o pid,ppid,comm | grep $current_pid | awk -v current_pid_var=$current_pid '$1==current_pid_var{print $2}')
file="$mypath/${parent_id}.dir"
if [ ! -f "$file" ]
then
touch $file
fi
filecontent=`cat $file`
pwd > $file
echo "$filecontent" >> $file
# sed "1 i ${PWD}" "$file" > $file
oldpath=$PWD
cd $1
echo "$oldpath --> $PWD"
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。