当前位置:网站首页>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边栏推荐
- Grabbing and sorting out external articles -- status bar [4]
- Paddle framework: paddlenlp overview [propeller natural language processing development library]
- 使用npm发布自己开发的工具包笔记
- 2022 PMP project management examination agile knowledge points (8)
- 【Flask】静态文件与模板渲染
- leetcode3、实现 strStr()
- leetcode刷题_反转字符串中的元音字母
- [Jiudu OJ 09] two points to find student information
- selenium 元素定位(2)
- 同一个 SqlSession 中执行两条一模一样的SQL语句查询得到的 total 数量不一样
猜你喜欢
【Flask】官方教程(Tutorial)-part2:蓝图-视图、模板、静态文件
抓包整理外篇——————状态栏[ 四]
[flask] official tutorial -part2: Blueprint - view, template, static file
PHP campus financial management system for computer graduation design
1. Introduction to basic functions of power query
NumPy 数组索引 切片
插卡4G工业路由器充电桩智能柜专网视频监控4G转以太网转WiFi有线网速测试 软硬件定制
2 power view
Redis-列表
leetcode3、實現 strStr()
随机推荐
How does redis implement multiple zones?
XSS learning XSS lab problem solution
500 lines of code to understand the principle of mecached cache client driver
Initialize MySQL database when docker container starts
使用npm发布自己开发的工具包笔记
Redis string type
Reasonable and sensible
一图看懂!为什么学校教了你Coding但还是不会的原因...
Redis key operation
Ali test Open face test
同一个 SqlSession 中执行两条一模一样的SQL语句查询得到的 total 数量不一样
[Jiudu OJ 09] two points to find student information
Sword finger offer 38 Arrangement of strings
MCU lightweight system core
How to upgrade kubernetes in place
Leetcode3, implémenter strstr ()
一圖看懂!為什麼學校教了你Coding但還是不會的原因...
leetcode-2.回文判断
Redis-列表
Accelerating spark data access with alluxio in kubernetes