Linked Questions

-1 votes
1 answer
94 views

I'm new in shell scripting. As I discovered today, there are at least three ways to run a shell script: To execute it, using the absolute or a relative path: /folder1/folder2/script.sh ./script.sh ...
jsx97's user avatar
  • 1,387
0 votes
1 answer
68 views

Both of two lines below seems to execute my_script. What's the difference between the two processes? $ bash my_script $ source my_script
Jack Chen's user avatar
  • 189
0 votes
1 answer
63 views

Please help in knowing what is the usage of . in Unix scripting. For example: . /apps/Infor_shar/PSSRT/PSHUP/prsm/psnp_env
Gaurav Thakur's user avatar
0 votes
0 answers
29 views

I saw a question recently where a user wanted to ensure that his script is only executed by using source. My question is: what's the difference between ./test_script.sh and source test_script.sh? I ...
nagamani's user avatar
  • 181
0 votes
0 answers
19 views

I wrote a simple script for generating aliases in zsh shell. Here it is: for subject in $(find $path -maxdepth 2 -type d -print) do dir=$(printf -- "$subject\n" | sed 's|.*/||') alias &...
Fedja's user avatar
  • 125
106 votes
11 answers
146k views

Is there a way to execute a command in a different directory without having to cd to it? I know that I could simply cd in and cd out, but I'm just interested in the possibilities of forgoing the extra ...
Naftuli Kay's user avatar
  • 41.6k
35 votes
2 answers
49k views

I recently learned, that . ./.a.a and ./.a.a is the same. However trying source source .a.a gives an error. IMO, . being Bash alias for source shouldn't behave differently, so what am I missing? ...
LAFK says Reinstate Monica's user avatar
15 votes
3 answers
10k views

I created a Bash script which echoes "Hello World". I also created a test user, bob, using adduser. Nobody has permission to execute that file as denoted by ls: $ ls -l hello.sh -rw-r--r-- 1 ...
Themelis's user avatar
  • 421
13 votes
3 answers
20k views

Are there any differences between commands that you type into the terminal and commands you include in a script?
jboy12's user avatar
  • 296
2 votes
3 answers
4k views

I'm learning awk today, but I cannot succeed in having the most simple scripts to work. #!/usr/bin/env -S awk -f BEGIN { } { } END { } this outputs BEGIN: command not found or even #!/usr/bin/env -...
Stephane Rolland's user avatar
2 votes
2 answers
1k views

What method does the login shell use to read /etc/profile?
Ms.Sahin's user avatar
2 votes
2 answers
5k views

Having looked at Setting up environment variables with .sh file and How to permanently set environmental variables I'm still confused as to how to properly set permanent environment variables from a ....
Jonathan Woollett-light's user avatar
2 votes
1 answer
2k views

I have picked up a habit of including . from some blog post: 0 0 * * * . /usr/local/bin/somescript.sh ...instead of: 0 0 * * * /usr/local/bin/somescript.sh For instance a visual cron schedule ...
user598527's user avatar
1 vote
2 answers
6k views

I am trying to use a ready-made bash script that sets env. This is the service that I'm trying to use: [Unit] Description=myserver service After=multi-user.target [Service] Type=simple User=ec2-user ...
user63898's user avatar
  • 343
3 votes
1 answer
2k views

I want to run source ./script_name instead of ./script_name. Can I create an alias for this ? The Jenkins job will run the script as ./script_name and I can't edit the way it will run the script on ...
Anubhav Rai's user avatar

15 30 50 per page