Unix/Linux Go Back    


Homework & Coursework Questions Students must use and complete the template provided. If you don't, your post may be deleted! Special homework rules apply here.

Help with shell scrip syntax errors

Homework & Coursework Questions


Reply    
 
Thread Tools Search this Thread Display Modes
    #8  
Old Unix and Linux 10-15-2016
Demas Demas is offline
Registered User
 
Join Date: Oct 2016
Last Activity: 15 October 2016, 2:43 PM EDT
Posts: 7
Thanks: 6
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by RudiC View Post
How did you add them?

Code:
echo "$channel_remove" << "channels.txt"

won't work, no way!

Code:
 sed -E "s/$channel_remove//g"

Sponsored Links
    #9  
Old Unix and Linux 4 Weeks Ago
Chrismcq Chrismcq is offline
Registered User
 
Join Date: Jan 2017
Last Activity: 24 January 2017, 10:46 AM EST
Posts: 7
Thanks: 0
Thanked 2 Times in 2 Posts
Surely to remove a channel, you need to


Code:
grep -v "$channel_remove" channels.txt > channels.NEW
mv channels.NEW channels.txt


ps - just noticed the sed command that Demas had posted which will answer this query too.
Sponsored Links
    #10  
Old Unix and Linux 3 Weeks Ago
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 19 February 2017, 8:41 AM EST
Location: Loughborough
Posts: 1,147
Thanks: 337
Thanked 299 Times in 231 Posts
Take note of the last line, done .
Something is missing, for example...

Code:
while true
do
        lots of code here
done        #Your line 48 as 49 does not technically exist.

Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Seek help on shell script syntax errors duke0001 Emergency UNIX and Linux Support 8 08-03-2011 04:06 AM
Get file name in shell scrip loop: bad substitution soueric Solaris 4 05-03-2011 12:20 AM
how to combine two files into one file using shell scrip netbanker Shell Programming and Scripting 2 12-06-2010 06:34 PM
How to convert shell scrip to binaric command raghunsi UNIX for Advanced & Expert Users 1 02-03-2010 02:27 AM
Using cp command inside shell scrip yoavbe Shell Programming and Scripting 2 06-22-2006 10:57 AM



All times are GMT -4. The time now is 10:15 PM.