Unix/Linux Go Back    

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

Homework & Coursework Questions

Thread Tools Search this Thread Display Modes
Old Unix and Linux 10-15-2016   -   Original Discussion by Demas
Demas's Unix or Linux Image
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 Unix and Linux 01-19-2017   -   Original Discussion by Demas
Chrismcq's Unix or Linux Image
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 Unix and Linux 01-24-2017   -   Original Discussion by Demas
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
Join Date: Jan 2013
Last Activity: 19 May 2018, 3:23 PM EDT
Location: Loughborough
Posts: 1,261
Thanks: 377
Thanked 338 Times in 265 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

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 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 04:26 PM.