当前位置:网站首页>How to set an alias inside a bash shell script so that is it visible from the outside?
How to set an alias inside a bash shell script so that is it visible from the outside?
2022-07-06 01:54:00 【French red wine sweet】
problem :
OSX: This works from the command line:OSX: This can work from the command line :
alias ruby="/opt/local/bin/ruby1.9"
but in side a shell script, it has no effect. But in shell Script , It has no effect .I want to write a script that will switch between ruby 1.8 and ruby 1.9, so this needs to be a script - not in my profile. I want to write a ruby 1.8 and ruby 1.9 Switch between scripts , So this needs to be a script - Not in my profile .
It appears "source script.sh" works, but "./script.sh". look “source script.sh” It works , however “./script.sh”.Why is this? Why is that ?How can I replicate this in my script? How can I copy this in the script ?
Solution :
Reference resources : https://stackoom.com/en/question/9Dev边栏推荐
- Flutter Doctor:Xcode 安装不完整
- It's wrong to install PHP zbarcode extension. I don't know if any God can help me solve it. 7.3 for PHP environment
- selenium 元素定位(2)
- 02. Go language development environment configuration
- 【Flask】静态文件与模板渲染
- Basic operations of databases and tables ----- unique constraints
- 阿裏測開面試題
- How to upgrade kubernetes in place
- 2022年PMP项目管理考试敏捷知识点(8)
- ctf. Show PHP feature (89~110)
猜你喜欢
Blue Bridge Cup embedded_ STM32_ New project file_ Explain in detail
Computer graduation design PHP animation information website
Force buckle 9 palindromes
使用npm发布自己开发的工具包笔记
一圖看懂!為什麼學校教了你Coding但還是不會的原因...
leetcode刷题_平方数之和
2022 PMP project management examination agile knowledge points (8)
[机缘参悟-39]:鬼谷子-第五飞箝篇 - 警示之二:赞美的六种类型,谨防享受赞美快感如同鱼儿享受诱饵。
Grabbing and sorting out external articles -- status bar [4]
Open source | Ctrip ticket BDD UI testing framework flybirds
随机推荐
01. Go language introduction
正则表达式:示例(1)
How does redis implement multiple zones?
Genius storage uses documents, a browser caching tool
【Flask】静态文件与模板渲染
dried food! Accelerating sparse neural network through hardware and software co design
A picture to understand! Why did the school teach you coding but still not
Kubernetes stateless application expansion and contraction capacity
PHP campus financial management system for computer graduation design
selenium 元素定位(2)
【SSRF-01】服务器端请求伪造漏洞原理及利用实例
Gbase 8C database upgrade error
Selenium waiting mode
Redis key operation
使用npm发布自己开发的工具包笔记
Basic operations of databases and tables ----- non empty constraints
Computer graduation design PHP enterprise staff training management system
【全网最全】 |MySQL EXPLAIN 完全解读
Shutter doctor: Xcode installation is incomplete
[flask] official tutorial -part2: Blueprint - view, template, static file