Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #255578

alias in bash script issue

From Ken Young <ken@highwinds.cloud>
Newsgroups linux.debian.user
Subject alias in bash script issue
Date 2023-03-04 09:40 +0100
Message-ID <G5vAR-9YKb-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hello,

Do you know why my alias can't work in the bash script?
The info is as follows.

1)  this alias does exist

$ alias |grep 'k='

alias k='minikube kubectl --'


2) it also exists in .bash_profile

$ cat ~/.bash_profile |grep 'k='

alias k="minikube kubectl --"


3) the content of bash script

$ cat get.sh

#!/bin/bash


source ~/.bash_profile

k get node


4) alias can't work

$ ./get.sh

./get.sh: line 5: k: command not found


The system is debian 11 and the shell is bash.

Please give suggestions. Thank you.


regards.

Back to linux.debian.user | Previous | NextNext in thread | Find similar | Unroll thread


Thread

alias in bash script issue Ken Young <ken@highwinds.cloud> - 2023-03-04 09:40 +0100
  Re: alias in bash script issue David <bouncingcats@gmail.com> - 2023-03-04 11:00 +0100
    Re: alias in bash script issue Tom Furie <tom@furie.org.uk> - 2023-03-04 14:20 +0100
      Re: alias in bash script issue David <bouncingcats@gmail.com> - 2023-03-04 15:50 +0100
        Re: alias in bash script issue Greg Wooledge <greg@wooledge.org> - 2023-03-04 17:30 +0100
    Re: alias in bash script issue David Wright <deblis@lionunicorn.co.uk> - 2023-03-04 18:20 +0100
      Re: alias in bash script issue Greg Wooledge <greg@wooledge.org> - 2023-03-04 18:30 +0100
        Re: alias in bash script issue David Wright <deblis@lionunicorn.co.uk> - 2023-03-05 21:40 +0100
          Re: alias in bash script issue Greg Wooledge <greg@wooledge.org> - 2023-03-05 22:40 +0100
            Re: alias in bash script issue David Wright <deblis@lionunicorn.co.uk> - 2023-03-07 03:50 +0100
    Re: alias in bash script issue Ken Young <ken@highwinds.cloud> - 2023-03-05 02:30 +0100
      Re: alias in bash script issue Greg Wooledge <greg@wooledge.org> - 2023-03-05 02:40 +0100
        Re: alias in bash script issue Tom Browder <tom.browder@gmail.com> - 2023-03-05 12:30 +0100
          Re: alias in bash script issue Ken Young <ken@highwinds.cloud> - 2023-03-05 12:40 +0100
            Re: alias in bash script issue Tom Browder <tom.browder@gmail.com> - 2023-03-05 12:50 +0100
              Re: alias in bash script issue Nicolas George <george@nsup.org> - 2023-03-05 14:30 +0100
                Re: alias in bash script issue <tomas@tuxteam.de> - 2023-03-05 17:10 +0100
                Re: alias in bash script issue Tom Browder <tom.browder@gmail.com> - 2023-03-07 13:10 +0100
            Re: alias in bash script issue <tomas@tuxteam.de> - 2023-03-05 14:10 +0100
  Re: alias in bash script issue Yassine Chaouche <a.chaouche@algerian-radio.dz> - 2023-03-06 11:10 +0100

csiph-web