Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 08-19-2007, 12:06 AM   #1 (permalink)
Greg's Avatar
 
Indeed.

Join Date: Dec 2004

Posts: 1,554

Greg is on a distinguished road

Default BASH Questions

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.

Thanks
__________________
Greg is offline  
Old 08-19-2007, 12:10 AM   #2 (permalink)
Greg's Avatar
 
Indeed.

Join Date: Dec 2004

Posts: 1,554

Greg is on a distinguished road

Default Re: BASH Questions

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:

#!/bin/bash 
vlcinfo=`echo info | netcat localhost 12345 -q 1 | grep Title | cut -c10-` 
echo "Song title: $vlcinfo" 


But running this script will work fine:
Code:

#!/bin/bash 
echo "Song title: `echo info | netcat localhost 12345 -q 1 | grep Title | cut -c10-`" 
  


I'm trying to use this in an if statement, so the above are just examples.


__________________

Last edited by Greg; 08-19-2007 at 01:19 AM.
Greg is offline  
Old 08-19-2007, 12:39 AM   #3 (permalink)
Greg's Avatar
 
Indeed.

Join Date: Dec 2004

Posts: 1,554

Greg is on a distinguished road

Default Re: BASH Questions

Whoops, please delete this post.
__________________

Last edited by Greg; 08-19-2007 at 01:19 AM.
Greg is offline  
Old 08-19-2007, 01:55 AM   #4 (permalink)
Sodaen's Avatar
 
True Techie

Join Date: Aug 2007

Posts: 180

Sodaen is on a distinguished road

Default Re: BASH Questions

Cron that s*** fool.

Oh...nevermind.
Sodaen is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Two questions before pulling the trigger... Portland Newb Building, Buying, or Upgrading High Performance PC Systems 12 08-16-2007 01:07 PM
Have some questions about reinstalling XP pro. MikeFuryXP Windows Operating Systems and Software 1 07-16-2007 10:09 PM
Case and PSU questions carnageX Building, Buying, or Upgrading High Performance PC Systems 14 07-02-2007 12:42 PM
questions valcan222 Building, Buying, or Upgrading High Performance PC Systems 12 06-01-2007 01:15 PM
Another BASH Script Greg Linux, BSD, other *nixes & Open Source Software 2 04-17-2007 06:35 PM