zsh: permission denied



#!/bin/bash
for ip in {1..254}; do
ping-c 1$1,$ip|grep"64 byts"| cut-d""
-f 4|tr-d":"&
done
Can you explain what you are trying to accomplish?
 
When you are running the script I made a couple of changes to it - this will remind you to add an IP address if you run it without one
==========================================
#!/bin/bash

if [ "$1" == "" ]
then
echo "Did you forget the IP Address!"
echo "Syntax: sudo bash ./ipsweeper.sh 192.168.0.1"

else
for ip in {1..254}; do
ping -c 1 $1.$ip | grep "64 bytes" | cut -d " " -f 4 | tr -d ":" &
done
fi
=================================================
you have to remember to add the IP address when you run it
Code:
sudo bash ./ipsweeper.sh 192.168.0.1
you can use any IP address that your machine is using to list which IP address you can run
Code:
ip -4 addr
or
Code:
ip -6 addr
to get IP Address

If you use this copy what is in between the ======= into your text editor and save as ipsweeper.sh
PS - I just made a minor edit so it is correct now
 
Last edited by a moderator:
Hey man hope you didn't give up, but I'm taking the same course you put your sequence in single quotations and not tildas it doesn't seem like anyone else caught that but I did that and ran it with sudo bash and it worked what it looks like works with an ip too
20230902_103332.jpg
 
You should really start your own thread in the Kali sub-forum.
 
It might be a zsh setting that prevents executing from certain directories. I just can't recall which one or where it's set.
 
you're missing a space between ping and -c. And some more after that. Plese post the script as a code block.
 

Members online


Top