how to create new options of "dd command" using bash script?

 
Thread Tools Search this Thread
Homework and Emergencies Homework & Coursework Questions how to create new options of "dd command" using bash script?
# 1  
Old 03-01-2012
how to create new options of "dd command" using bash script?

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

1. The problem statement, all variables and given/known data:
Creating bash script the dd command and its new options (-l -U)
-l options to lowercase contents of file
-U options to UPPERCASE contents of file
in such a way that when it invokes the
Code:
dd -U if=test of=test.bak

then the output of contents of file will become UPPERCASE or vise versa in the -l options



2. Relevant commands, code, scripts, algorithms:
Sample:

vi test and press Enter
Code:
#! /bin/bash
this is the test script to make contents of file UPPERCASE

vi test2 and press Enter

Code:
#! /bin/bash
THIS IS THE TEST2 SCRIPT TO MAKE CONTENTS OF FILE lowercase

then press Enter again..
Type:
chmod a+x test

And in command line type:
dd -U if=test of=test.bak and press Enter
dd -l if=test2 of=test2.bak and press Enter
Output the 2 should be:


THIS IS THE TEST SCRIPT TO MAKE CONTENTS OF FILE UPPERCASE

this is the test2 script to make contents of file lowercase



3. The attempts at a solution (include all code and scripts):
Code:
#! /bin/bash
this is the test script to make contents of file UPPERCASE


4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):

San Lazaro University, New york (California), United States, Instructor Maldeo Meinier, OS221

Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
# 2  
Old 03-01-2012
Hi katherineskye1,

We cannot find your university in New York on the net. Please provide a link to this school.

Thanks!
# 3  
Old 03-01-2012
To get you started, many have tried to understand this assignment this week.
There are suggestions this closed thread.
https://www.unix.com/shell-programmin...g-command.html

I'm not clear whether your solution is allowed to use the "dd" command or not?
The "dd" command is unusual in unix because it uses the syntax "switch=value" rather than the more usual "-switch value" or the Linux "--switch=value".


Tip: I'd avoid calling a script "test". It is the name of a unix command.

Last edited by methyl; 03-01-2012 at 01:58 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

3. Shell Programming and Scripting

Short command to create two files >{respo,nd}.php (with "tee" command?)

08:29 < xsi> >{respo,nd}.php bash: {respo,nd}.php: ambiguous redirect 08:31 < geirha> xsi: maybe you want tee So I was advised to do so. And I can't create two OR MORE files at once with {a,b,c,d,e,f}.php (which I quickly now need to create and to learn to create in the future to quickly... (2 Replies)
Discussion started by: Xcislav
2 Replies

4. UNIX for Dummies Questions & Answers

"Help with bash script" - "License Server and Patch Updates"

Hi All, I'm completely new to bash scripting and still learning my way through albeit vey slowly. I need to know where to insert my server names', my ip address numbers through out the script alas to no avail. I'm also searching on how to save .sh (bash shell) script properly.... (25 Replies)
Discussion started by: profileuser
25 Replies

5. Shell Programming and Scripting

Bash Script giving "Command Not found"

Hello Geeks, Greetings...I have the following script: #!/usr/bin/bash #Script to generate number of active PDP context & calculate PDP activation #failurefrom EPG-M #Script written by Gbenga Adigun #September 12, 2013 username="xxxxxx" password="xxxxxxxxx" HOSTS=( ggsn01... (6 Replies)
Discussion started by: infinitydon
6 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. AIX

Typing "bash" at the command line spawns two bash processes

Server: IBM p770 OS: AIX 6.1 TL5 SP1 When one of our develoeprs types "bash" on the command line to switch shells, it hangs. For some reason, two bash processes are created....the first bash process spawns a second bash process in the same console, causing a hang. Anyone have any idea what... (2 Replies)
Discussion started by: wjssj
2 Replies

8. Shell Programming and Scripting

Simplify Bash Script Using "sed" Or "awk"

Input file: 2 aux003.net3.com error12 6 awn0117.net1.com error13 84 aux008 error14 29 aux001.ha.ux.isd.com error12 209 aux002.vm.ux.isd.com error34 21 alx0027.vm.net2.com error12 227 dux001.net5.com error123 22 us008.dot.net2.com error121 13 us009.net2.com error129Expected Output: 2... (4 Replies)
Discussion started by: sQew
4 Replies

9. UNIX for Dummies Questions & Answers

Any options with "cp" to create a folder if it doesn't exist.

I've created a backup and restore script and it's working fine so it's all about making it more robust at the moment for me. Let's say the user has a folder in their home directory for word processing files called "wp". I want to copy the files I made a backup of from this directory back into it.... (2 Replies)
Discussion started by: EwanD
2 Replies

10. UNIX for Dummies Questions & Answers

Alias, function or script (bash) to "revert" cd command?

In all of my brief and superficial experience with Unix or Linux, the one curious and consistent thing has been that 'cd ./' (back up one directory level) has done absolutely nothing in any of them. Now I understand that, at least for bash, 'cd ./' appears to have been substituted by 'cd ..' Am... (1 Reply)
Discussion started by: SilversleevesX
1 Replies
Login or Register to Ask a Question