当前位置:网站首页>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边栏推荐
- [flask] response, session and message flashing
- [the most complete in the whole network] |mysql explain full interpretation
- 【全網最全】 |MySQL EXPLAIN 完全解讀
- 国家级非遗传承人高清旺《四大美人》皮影数字藏品惊艳亮相!
- [flask] official tutorial -part2: Blueprint - view, template, static file
- Ali test open-ended questions
- Leetcode skimming questions_ Invert vowels in a string
- Redis key operation
- 阿裏測開面試題
- 01.Go语言介绍
猜你喜欢

National intangible cultural heritage inheritor HD Wang's shadow digital collection of "Four Beauties" made an amazing debut!

Leetcode3, implémenter strstr ()

Basic operations of database and table ----- set the fields of the table to be automatically added

leetcode刷题_验证回文字符串 Ⅱ

Extracting key information from TrueType font files

Poj2315 football games

Alibaba canal usage details (pit draining version)_ MySQL and ES data synchronization

Computer graduation design PHP animation information website

Selenium waiting mode

3D视觉——4.手势识别(Gesture Recognition)入门——使用MediaPipe含单帧(Singel Frame)和实时视频(Real-Time Video)
随机推荐
【Flask】官方教程(Tutorial)-part1:项目布局、应用程序设置、定义和访问数据库
Docker compose configures MySQL and realizes remote connection
ctf. Show PHP feature (89~110)
D22:indeterminate equation (indefinite equation, translation + problem solution)
竞价推广流程
Superfluid_ HQ hacked analysis
Win10 add file extension
Luo Gu P1170 Bugs Bunny and Hunter
Selenium waiting mode
Computer graduation design PHP enterprise staff training management system
LeetCode 322. Change exchange (dynamic planning)
You are using pip version 21.1.1; however, version 22.0.3 is available. You should consider upgradin
NLP第四范式:Prompt概述【Pre-train,Prompt(提示),Predict】【刘鹏飞】
【全网最全】 |MySQL EXPLAIN 完全解读
Ali test open-ended questions
How does redis implement multiple zones?
[flask] official tutorial -part1: project layout, application settings, definition and database access
leetcode-两数之和
PHP error what is an error?
Alibaba-Canal使用详解(排坑版)_MySQL与ES数据同步