当前位置:网站首页>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边栏推荐
- Get the relevant information of ID card through PHP, get the zodiac, get the constellation, get the age, and get the gender
- XSS learning XSS lab problem solution
- Unity learning notes -- 2D one-way platform production method
- Blue Bridge Cup embedded_ STM32 learning_ Key_ Explain in detail
- [flask] static file and template rendering
- NumPy 数组索引 切片
- 【Flask】获取请求信息、重定向、错误处理
- How to get all sequences in Oracle database- How can I get all sequences in an Oracle database?
- Selenium waiting mode
- 1. Introduction to basic functions of power query
猜你喜欢

Basic operations of databases and tables ----- primary key constraints

How does the crystal oscillator vibrate?
![[Jiudu OJ 09] two points to find student information](/img/35/25aac51fa3e08558b1f6e2541762b6.jpg)
[Jiudu OJ 09] two points to find student information

c#网页打开winform exe

Cookie concept, basic use, principle, details and Chinese transmission

Mongodb problem set

Selenium waiting mode

Leetcode skimming questions_ Invert vowels in a string

02.Go语言开发环境配置

Win10 add file extension
随机推荐
selenium 元素定位(2)
A Cooperative Approach to Particle Swarm Optimization
Computer graduation design PHP part-time recruitment management system for College Students
[flask] obtain request information, redirect and error handling
Redis-字符串类型
LeetCode 322. Change exchange (dynamic planning)
MCU lightweight system core
[detailed] several ways to quickly realize object mapping
3D vision - 4 Getting started with gesture recognition - using mediapipe includes single frame and real time video
Flowable source code comments (36) process instance migration status job processor, BPMN history cleanup job processor, external worker task completion job processor
leetcode3、實現 strStr()
NiO related knowledge (II)
leetcode刷题_验证回文字符串 Ⅱ
[flask] response, session and message flashing
Blue Bridge Cup embedded_ STM32_ New project file_ Explain in detail
Gbase 8C database upgrade error
Leetcode skimming questions_ Invert vowels in a string
插卡4G工业路由器充电桩智能柜专网视频监控4G转以太网转WiFi有线网速测试 软硬件定制
Initialize MySQL database when docker container starts
Paddle framework: paddlenlp overview [propeller natural language processing development library]