I want to pass the output of a command as a positional parameter to a script file. Please see my team below.
whois -h 192.168.0.13 google.com | grep -e Domain\ Name
This command will give me a "name". What I want to do is pass this output again to the shell script file as a positional parameter.
my-file.sh:
#!/bin/bash
if [ $1 == "my-domain-name" ]; then
echo "It is ok"
exit 1
fi
So basically what I want to do is something like this.
whois -h 192.168.0.13 google.com | grep -e Domain\ Name | -here pass the Name to my-file.sh and run that file
source
share