Homework & Coursework Questions

Students must use and complete the template provided. If you do not use the template your post may be deleted! Special homework rules apply here.

Help with shell scrip syntax errors

👤 Login to reply

Thread Tools Search this Thread Display Modes
Old 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
Originally Posted by RudiC View Post
How did you add them?
echo "$channel_remove" << "channels.txt"

won't work, no way!
 sed -E "s/$channel_remove//g"

Sponsored Links
Old 01-19-2017
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

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
Old 01-24-2017
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
Join Date: Jan 2013
Last Activity: 20 July 2018, 6:06 AM EDT
Location: Loughborough
Posts: 1,294
Thanks: 388
Thanked 352 Times in 277 Posts
Take note of the last line, done .
Something is missing, for example...
while true
        lots of code here
done        #Your line 48 as 49 does not technically exist.

Sponsored Links
👤 Login to reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 03:06 AM
Get file name in shell scrip loop: bad substitution soueric Solaris 4 05-02-2011 11:20 PM
how to combine two files into one file using shell scrip netbanker Shell Programming and Scripting 2 12-06-2010 05:34 PM
How to convert shell scrip to binaric command raghunsi UNIX for Advanced & Expert Users 1 02-03-2010 01:27 AM
Using cp command inside shell scrip yoavbe Shell Programming and Scripting 2 06-22-2006 09:57 AM

All times are GMT -4. The time now is 06:38 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
Show Password

Not a Forum Member?
Forgot Password?