Reload .profile in bash shell script (in unix)?

后端 未结 5 1843
有刺的猬
有刺的猬 2021-01-29 22:29

I\'m new to bash shell scripting, and have come across a challenge. I know I can reload my \".profile\" file by just doing:

. .profile

but I\'m

5条回答
  •  南笙
    南笙 (楼主)
    2021-01-29 23:16

    Try:

    #!/bin/bash
    # .... some previous code ...
    # help set exec | less
    set -- 1 2 3 4 5  # fake command line arguments
    exec bash --login -c '
    echo $0
    echo $@
    echo my script continues here
    ' arg0 "$@"
    

提交回复
热议问题