当前位置:网站首页>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边栏推荐
- GBase 8c数据库升级报错
- 使用npm发布自己开发的工具包笔记
- Computer graduation design PHP enterprise staff training management system
- Cadre du Paddle: aperçu du paddlelnp [bibliothèque de développement pour le traitement du langage naturel des rames volantes]
- Leetcode skimming questions_ Verify palindrome string II
- leetcode3、實現 strStr()
- How does the crystal oscillator vibrate?
- Format code_ What does formatting code mean
- leetcode刷题_验证回文字符串 Ⅱ
- leetcode-两数之和
猜你喜欢
Computer graduation design PHP enterprise staff training management system
Publish your own toolkit notes using NPM
Unity learning notes -- 2D one-way platform production method
leetcode刷题_平方数之和
Basic operations of databases and tables ----- default constraints
500 lines of code to understand the principle of mecached cache client driver
Force buckle 1020 Number of enclaves
Card 4G industrial router charging pile intelligent cabinet private network video monitoring 4G to Ethernet to WiFi wired network speed test software and hardware customization
抓包整理外篇——————状态栏[ 四]
一图看懂!为什么学校教了你Coding但还是不会的原因...
随机推荐
Maya hollowed out modeling
01.Go语言介绍
[Yu Yue education] Liaoning Vocational College of Architecture Web server application development reference
module ‘tensorflow. contrib. data‘ has no attribute ‘dataset
Leetcode skimming questions_ Sum of squares
安装Redis
Selenium element positioning (2)
Kubernetes stateless application expansion and contraction capacity
leetcode-2. Palindrome judgment
【网络攻防实训习题】
Alibaba canal usage details (pit draining version)_ MySQL and ES data synchronization
【全网最全】 |MySQL EXPLAIN 完全解读
02.Go语言开发环境配置
NLP第四范式:Prompt概述【Pre-train,Prompt(提示),Predict】【刘鹏飞】
LeetCode 322. Change exchange (dynamic planning)
Superfluid_ HQ hacked analysis
Force buckle 1020 Number of enclaves
干货!通过软硬件协同设计加速稀疏神经网络
Redis-Key的操作
【全網最全】 |MySQL EXPLAIN 完全解讀