I'm trying to write a script to DL AV updates, and I'm trying to ensure that the script can verify an internet connection before beginning (long story, but not relevant to this discussion).
I've gotten the script to otherwise do what I want, I just don't want it to bother to execute if it won't be able to DL stuff anyway.
When testing, the following lines of script:
Code:
interPing='ping www.google.com | grep time'
$interPing
I get the following error:
Code:
ping: unknown host |
I'm getting my syntax from the bash man pages and various tutorials online. I've also tried to use double quotes, leave the "| grep time" portion outside of the ''s. All with the same result.
I've also tried doing it this way:
Code:
interPing=$(ping www.google.com | grep time)
...but the cursor just hangs and I have to Ctrl-C the command.
I'm fairly competant in the Linux world, but don't do a whole lot of heavy scripting. If anyone can illuminate me, I'd greatly appreciate it.
Thanks in advance,
Samuel deHuszar Allen