In my script I want to run a command that doesn't exit, but I want the script to continue. Once the script exits I still want the command to still be running. I guess this is sort of a BASH newb question, but meh.
Solved the below problem. Still need the answer to my first one, though.
I have another question to go along with the first.
The command echo info | netcat localhost 12345 -q 1 | grep Title | cut -c10- will output the name of the song that is playing in VLC, but I can't seem to set this as a variable and use it. Here's an example:
Running this script will just output "Song title: "
Code:
[SIZE=2][COLOR=Gray]
#!/bin/bash
vlcinfo=`echo info | netcat localhost 12345 -q 1 | grep Title | cut -c10-`
echo "Song title: $vlcinfo"[/COLOR][/SIZE]
But running this script will work fine:
Code:
[SIZE=2][COLOR=Gray]
#!/bin/bash
echo "Song title: `echo info | netcat localhost 12345 -q 1 | grep Title | cut -c10-`"[/COLOR][/SIZE][SIZE=2][COLOR=Gray]
[/COLOR][/SIZE]
I'm trying to use this in an if statement, so the above are just examples.