Ubuntu Scripting in bash : Homework Assistance

2017-01-11  Source: Original Site  Category:Ubuntu  Views:260 


everyone. Before I get to the problem, it might help if I gave you a bit of a background on my problem(s).

I'm pretty new to nix, and taking an into to UNIX class at my college and it operates on the principle of learning UNIX with linux. Aside from the fact that my professor is a mad-woman and arguably incapeable of teaching (I asked her a question earlier via e-mail and she told me to wait 24 hours and if I couldn't find the answer to e-mail her again >.<). So here we are, unit 6, talking about X windows, GNOME & KDE and out of nowhere comes an assignment to write a batch file so I'm at somewhat of a loss, especially since asking the instructor is somewhat out of the question.:(

And we are not using our own machines but rather using SSH to connect to a college UNIX machine to work off of, that might be of some relevance too.

So the assignment is oddly themed to break a code, we have a main file to work off of, call it file1, and file2 and file3 to incorperate into it. File 1 is jumble and we use sed commands to change things in it and cat, sed, tr and what not to insert file2 and file 3 to hopefully have it make sense in the end.

The actual assignment description is:
Create a batch set of sed commands (i.e., a repeatable script) to make the following changes to blue_bird_of_paradise.txt

And here is a sample of the actions we need to perform:
Change all occurrences of * to t
Capitalize the first t in lines 5 and 11
Change all occurrences of 5 to dd
Change all occurrences of 4 to n
Change all occurrences of 2 to o
Change the first occurrence of o in lines 1, 2, and 6 to O.

I can understand how to issue the commands as needed with sed to perform the actions requested with replacement but as far as a repeatable script, I am at a complete loss. I've tried working off a few basic tutorials but it seems as though I can't even begin to write the script as I get:

bash: !/bin/bash: event not found


bash: !/usr/bin/bash: event not found

If anyone has time could the point me in the right direction please?

Related articles
  • Ubuntu Scripting in bash : Homework Assistance 2017-01-11

    everyone. Before I get to the problem, it might help if I gave you a bit of a background on my problem(s). I'm pretty new to nix, and taking an into to UNIX class at my college and it operates on the principle of learning UNIX with linux. Aside from

  • Ubuntu Script Problem (Bash) 2015-04-26

    I must write a script that does the following: Display the name of the script being executed. Display the first, third and tenth argument given to the script. Display the total numbers of arguments passed to the script. If there were more than three

  • Ubuntu Scripting in bash... 2015-01-08

    I'm not sure weather it's possible or not, but would it be possible to make a script that goes the the directory typed into the terminal, as I'm making a script that is newbie-friendly for compiling software. Anyway, would it be possible to make the

  • Ubuntu How to bash script Dual Monitors 2013-12-05

    Bodhi's Dual Monitor script. This is a bash script which will give you a GUI to start your dual monitors. Features: You may select to run fluxbox, gnome, KDE, icewm, openbox, or xfce with choice of monitor configurations- twinview, dual monitors, or

  • Ubuntu I made my first GUI Script in Bash with Zenity... 2014-05-03

    I made my first GUI script in Bash with the help of Zenity i am so glad that its so so so easy to make your thoughts reality with Ubuntu and Bash... I am a Civil Engineer don't know much from programming but here you go ...i made all the corrections

  • Ubuntu writing scripts using bash 2012-10-10

    im looking to write a few scripts using bash , to help me learn, and to pass time. i have writen a few simple scripts before 1: script to move files from my camera to my pc when it was pluged in 2: to make an iso from a cd in the drive 3: same as abo

  • Ubuntu backup script with bash 2013-03-22

    I posted a thread in the beginner section a few days ago regarding the possibilities of running a backup from my server which would retreive certain files from hosts computers. Somebody suggested that this may be possible by writing a script in bash

  • Ubuntu Executing several bash scripts in succession even after reboot 2013-09-06

    I am new to shell programming. I am trying to automate setting up a network using several scripts. Some of the scripts require to reboot in order to continue with the setup. Is it possible to enter another script as soon as the system reboots. Also,

  • Ubuntu Problem with bash-script 2014-07-15

    Hi! I'm trying to make a automated build-script with bash but i keep getting different errors. Could anyone please tell me what's wrong with this build-script? I'm posing the main build-script and attaching the rest of the scripts in a compressed for

  • Ubuntu permissions with bash script 2014-10-08

    how do I run a bash script with my permissions. each of the following lines at the cli runs fine but in the script it errors script #!/bin/bash clear sourceFolder=/home/dev/Downloads/torrents destFolder=/srv/samba/share/ defOwner="nobody" defGroup="s

  • Ubuntu Script: ATI driver installer 2015-01-23

    I have stoped developing this script, but tworkemon has writtewn one and made it avialable on post 91 of this thread. (http://www.ubuntuforums.org/showthread.php?t=235145&page=10) for the 8.28.8 drivers. For some people the 8.27.10 script works f

  • [HELP] convert Perl script to Bash shell script 2012-07-01

    Need help converting the following Perl script to Bash shell script : #!/usr/bin/perl -w $SIG{INT} = 'IGNORE'; $SIG{TSTP} = 'IGNORE'; $SIG{TERM} = 'IGNORE'; $SIG{QUIT} = 'IGNORE'; print " Challenge1 : ";chomp($a=<STDIN>); print " Challenge2 : "

  • Ubuntu Scripting a PhotoBackup with md5deep 2012-07-12

    Hi. I'm new to scripting in bash, so pardon the general nature of this programming question. I'm trying to write a script to automate the backup of a large collection of digital photos. I'd like the script to do several things: 1. Compare the md5 che

  • Ubuntu Scripting windows registry offline editing! 2012-07-18

    As an administrator of a network with a Linux LDAP/SMB server and windows clients I occasionally have the need to change a user's settings. One way is to have the logon scripts load a registry change which works fine, but what if you need to find out

  • Ubuntu Script folder for mini netbook 2012-08-02

    Ubuntu Script folder for mini netbook: Hi, I would like to install Ubuntu on a Sylvania mini netbook. See the link below, click on the features tab of that page. http://digitalgadgets.com/mini-netbook.php This unit comes with Windows CE6. I love it.

  • Ubuntu tar --exclude [bash] 2012-12-07

    I'm making a backup script in bash. And I've just been testing it out, and with all of the encryption and compression, it becomes very slow, so I've decided to exclude some things. The first few lines of code go like this [Using different folder name

  • Ubuntu Scripting questions: backup to DVD and deleting files 2013-01-24

    I'd like to create two scripts in bash...how can I do this: First Script: Deleting .ORF Files I have .ORF and .JPEG files, each with the same name before extension (i.e., _15355.ORF and _15355.JPEG). I've deleted .JPEG files I don't want, and want to

  • How do i know if my ubuntu system has bash compiler? 2013-06-22

    Hi I'm a newbie. How do i know if my ubuntu system has bash compiler?

  • Ubuntu Awk and Bash Variable passing 2013-09-24

    I am writing a CGI script in Bash and Awk I need to pass Two variables into an awk statement heres my code ls -1 ./"$CMD" | awk -F'\n' '{ for (n=1;n<=NF;n++) { print "<a href=\"./" $CMD "/" $n "\">" $n "</n><br>" } }' the CMD is

  • Ubuntu Sliently fork bash 2014-01-20

    I am trying to start a script in bash that is forked off of the .bashrc. However, I want to make sure that this process that is forked off is entirely silent - No mention of "[1]+ Exit 1" or anything as such. I can silence the process itself, that's