I Have A Simple bash script
check_repo() {
if cat /etc/apt/sources.list | grep "deb https://http.kali.org/kali kali-rolling main contrib non-free" || cat /etc/apt/sources.list | grep "deb https://http.kali.org/kali kali-rolling main non-free contrib"
then
return 0
else
return 1
fi
}
check_repo
this script checks sources.list file if a particular repo is there or not if it is then it returns 0 & if it is not then it returns 1 but when i call the script using python3 by check = os.system("bash myscript.sh")
but when i print the variable "check" it prints 256
Why so output is given & how can i fix it?
- OS: Kali Linux
- Kernel: x86_64 Linux 5.9.0-kali4-amd64
- Shell: bash 5.1.0
Thanks for the answer in advance