当前位置:网站首页>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边栏推荐
- 2022 Guangxi Autonomous Region secondary vocational group "Cyberspace Security" competition and its analysis (super detailed)
- Leetcode skimming questions_ Sum of squares
- Basic operations of databases and tables ----- primary key constraints
- 正则表达式:示例(1)
- Redis daemon cannot stop the solution
- A Cooperative Approach to Particle Swarm Optimization
- Computer graduation design PHP part-time recruitment management system for College Students
- Genius storage uses documents, a browser caching tool
- 01. Go language introduction
- Redis string type
猜你喜欢

Leetcode skimming questions_ Invert vowels in a string

Initialize MySQL database when docker container starts

Basic operations of databases and tables ----- non empty constraints

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

c#网页打开winform exe

Accelerating spark data access with alluxio in kubernetes

Leetcode sum of two numbers

2022 PMP project management examination agile knowledge points (8)

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

Basic operations of database and table ----- delete data table
随机推荐
Redis守护进程无法停止解决方案
500 lines of code to understand the principle of mecached cache client driver
国家级非遗传承人高清旺《四大美人》皮影数字藏品惊艳亮相!
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
[flask] official tutorial -part1: project layout, application settings, definition and database access
一图看懂!为什么学校教了你Coding但还是不会的原因...
[Jiudu OJ 09] two points to find student information
[the most complete in the whole network] |mysql explain full interpretation
Basic operations of database and table ----- delete data table
Ali test open-ended questions
02.Go语言开发环境配置
同一个 SqlSession 中执行两条一模一样的SQL语句查询得到的 total 数量不一样
[le plus complet du réseau] | interprétation complète de MySQL explicite
NumPy 数组索引 切片
Reasonable and sensible
Kubernetes stateless application expansion and contraction capacity
【详细】快速实现对象映射的几种方式
阿里测开面试题
Format code_ What does formatting code mean
【Flask】官方教程(Tutorial)-part1:项目布局、应用程序设置、定义和访问数据库