Jump to content

How to replace patterns on a certain line number?

I want to replace patterns on a line number 

This line number would be incrementally changed (imagine an iterative variable that counts how many lines ) and supplied in the code as the line number and also for the pattern to be replaced.

 

 

I tried doing this using sed and bash variables but to no avail.

 

count=$((count))
for line in `cat dates.txt`; #enumerates through dates.txt, it is the same amount of lines that uploadscriptnodate.sh is
do
count=$((count + 1)) #creates variable count
echo $count
echo $line
sed '{$count}s/ASFKJL/{$line}/' uploadscriptnodate.sh #i can't figure out how to use variables within sed or awk for that matter
done

Any ideas?

Contents of dates.txt and uploadscriptnodate.sh

 

 

 

dates.txt

uploadscriptnodate.sh

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×