how can i pass the conv=ucase and conv=lcase in bash script?

 
Thread Tools Search this Thread
Homework and Emergencies Homework & Coursework Questions how can i pass the conv=ucase and conv=lcase in bash script?
# 1  
Old 03-07-2012
how can i pass the conv=ucase and conv=lcase in bash script?

how can i pass this dd command utility conv=ucase and conv=lcase in bash script?

if for example i have sample menu like:


Menu for translating contents of file

A.) translate contents of file to lowercase
B.) translate contents of file to uppercase

how to do this in the script so that the contents of file will become lower case if i choose letter A

... and

the contents of file will become uppercase if i choose B...??

by means of script only...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Pass config file to bash script

I just want to make sure I am understanding how to pass a config file to a bash script . In the below I pass to arguments to a script, then define them in the script as id and config. I then source config using ., if I understand correctly the variables in the config file can now be used by the... (11 Replies)
Discussion started by: cmccabe
11 Replies

2. Shell Programming and Scripting

Bash script - How to update header of scripts in one pass - multiline search/replace

Hello. A find command return a list of file. For each fileReplace the content starting with the first "§" (of two) ending with last "ɸ" (of two), regardless of the content ( five lines ) by the following content (exactly) : §2019_08_23§ # # ... (8 Replies)
Discussion started by: jcdole
8 Replies

3. UNIX for Beginners Questions & Answers

Pass RegEx to java program in bash script

I can't seem to get this right. I've tried it every way imaginable using every trick I see on stackexchange and such. No luck. So nothing major here, something like: #!/bin/bash SEARCH="ARG1 ARG2 '((^EXACT$)|(.*InTheMiddle*)|(^AtBeginning*))'" java -cp /my/class/path MyClassName $SEARCH... (3 Replies)
Discussion started by: stonkers
3 Replies

4. Shell Programming and Scripting

Curl , download file with user:pass in bash script

Hello, My question is about curl command. (ubuntu14.04) In terminal, I am able to download my mainfile with: curl -u user1:pass1 http://11.22.33.44/******* When I convert it into bash script like this: #!/bin/bash cd /root/scripts computer_ip=11.22.33.44 curl -u $1:$2... (8 Replies)
Discussion started by: baris35
8 Replies

5. Shell Programming and Scripting

How to pass enter key or selected character in bash script?

hi, i've bash script thats working... but now i need to add a line....that prompts for user input....like yes and 1 as complete install.... so here's how it looks... $ cd 9200 (cd into directory) $./install (hv to type ./install to run install then ask for) ----do you want to... (4 Replies)
Discussion started by: kernel11
4 Replies

6. Shell Programming and Scripting

Pass arguments to bash script

myscript.sh #!/bin/bash ARGA=$1 if ; then echo "${ARGA}:Confirmed" else echo "${ARGA}:Unconfirmed" fi when I run the above script from the command line, i run it as: ./myscript.sh jsmith now some times, i need to runn it this way: (8 Replies)
Discussion started by: SkySmart
8 Replies

7. Shell Programming and Scripting

How to Pass filename to AWK in bash script

I have written a script which works fine, to remove patterns contained in EXCLUDE.DAT from input.txt awk 'BEGIN {n=0;while (getline < "EXCLUDE.DAT" > 0){ex=$0;n++}} {for(var in ex){print var "-" ex $0 ;i++}}' input.txt The last problem I need to solve is how to pass the file... (3 Replies)
Discussion started by: nixie
3 Replies

8. Shell Programming and Scripting

How to pass value from plsql script to unix bash?

Hi This is my bash script.i am calling validation.sql and passing a value to it using ${flds}. i want the cnt variable in plsql script to be passed to unix. LOADREC=`sqlplus -s $ORACLE_USR <<-EOF spool $ORACLE_LOG_FILE; echo "barani" @validation.sql #calling the plsql script ${flds}... (6 Replies)
Discussion started by: barani75
6 Replies

9. Shell Programming and Scripting

Bash script pass sentence in block

Hello, I want to know is it possible to pass a block of sentence using bash. For example, I have a script called Test.sh that takes in $1 and $2. and I'm calling Test.sh in a.sh so in a.sh Test.sh '' 'This is a sentence' Because block are separated by space so when I do that, I get... (6 Replies)
Discussion started by: katrvu
6 Replies

10. UNIX for Dummies Questions & Answers

EBCDIC to ASCII conv for packed decimals.

By using dd command in Unix one can convert EBCDIC file into ASCII. It fails when it comes to having packed decimals within the EBCDIC file. The resultant of it has garbage chars. How can we have EBCDIC file convertedinto ASCII, which has packed decimal data in it? Thanks in advance. (3 Replies)
Discussion started by: videsh77
3 Replies
Login or Register to Ask a Question
dd(1)							      General Commands Manual							     dd(1)

Name
       dd - copy and convert data

Syntax
       dd [option = value...]

Description
       The  command copies an input file to an output with any requested conversions.  The command is especially suited to I/O on the raw physical
       devices because it allows reading and writing in arbitrary record sizes.

       After completion, reports the number of whole and partial input and output blocks.

       This utility supports EOT handling which allows the use of multiple media.  The utility prompts for the next volume when it encounters  the
       end of the current volume.

Options
       Where  sizes (n) are given for an option, the number may end with k for kilobytes (1024 bytes), b for blocks (512 bytes), or w for words (2
       bytes).	Also, two numbers may be separated by the character x to indicate a product.

       if=name		   Input file name.  The standard input is the default.

       of=name		   Output file name.  The standard output is the default.

       ibs=n		   Input block size, n bytes. The default is 512 bytes.  Some devices do not support greater than 65,535 bytes.

       obs=n		   Output block size, n bytes.	The default is 512 bytes.  Some devices do not support greater than 65,535 bytes.

       bs=n		   Set both input and output block size to n bytes, superseding ibs and obs.  Also, if bs is specified, the copy  is  more
			   efficient, since no blocking conversion is necessary.

       cbs=n		   Conversion buffer size, n bytes.  Use only if ascii, unblock, ebcdic, ibm, or block conversion is specified.  For ascii
			   and unblock, n characters are placed into the conversion buffer, any specified  character  mapping  is  done,  trailing
			   blanks are trimmed and new line added before sending the line to the output.  For ebcdic, ibm, or block, characters are
			   read into the conversion buffer, and blanks added to make an output record of size n bytes.

       skip=n		   Skip n input records before starting to copy.

       files=n		   Copy n input files before terminating.  This option is useful only when the input is a magnetic tape or similar device.

       seek=n		   Seek n records from beginning of output file before copying.

       rbuf=n		   Use n buffers for reading from those raw devices that support n-buffered I/O.  (See Section 4 to check whether  a  spe-
			   cific  device  supports  n-buffered	I/O.)	All n reads are started and each read must complete before the data can be
			   used.  This allows an n-buffered read-ahead on supported raw devices.

			   A default of eight read buffers are used if the read device supports n-buffered I/O and the write device does not.

			   The rbuf option cannot be used with the wbuf option.

       wbuf=n		   Use n buffers for writing from those raw devices that support n-buffered I/O.  (See Section 4 to check whether  a  spe-
			   cific  device  supports  n-buffered	I/O.)  Each write is started but not known to be complete until all n buffers have
			   been used.  (This allows an n-buffered write-behind on supported raw devices).

			   A default of eight write buffers are used if the write device supports n-buffered I/O.

			   The wbuf option cannot be used with the rbuf option.

       count=n		   Copy only n input records.

       conv=ascii	   Convert EBCDIC to ASCII.

       conv=ebcdic	   Convert ASCII to EBCDIC.

       conv=ibm 	   Slightly different map of ASCII to EBCDIC (see RESTRICTIONS).

       conv=block	   Convert variable length records to fixed length.

       conv=unblock	   Convert fixed length records to variable length.

       conv=lcase	   Map alphabetics to lower case.

       conv=ucase	   Map alphabetics to upper case.

       conv=swab	   Swap every pair of bytes.

       conv=noerror	   Do not stop processing on an error.

       conv=sync	   Pad every input record to ibs.

       conv=nomulti	   Disable multiple tape volumes.

       conv=sparse	   Create a sparse output file.

       conv=... , ...	   Include several arguments for the conv option, separated by commas (see example below).

Examples
       The following example shows how to read an EBCDIC tape blocked ten 80-byte EBCDIC card images per record into the ASCII file x:
       dd if=/dev/rmt0h of=x ibs=800 cbs=80 conv=ascii,lcase

       Note the use of raw magtape.  As noted in the DESCRIPTION, the command is especially suited to I/O on the raw physical devices  because	it
       allows reading and writing in arbitrary record sizes.

Restrictions
       The ASCII/EBCDIC conversion tables are taken from the 256-character standard in the Communications of the ACM, (R)November, 1968.

       The ibm conversion corresponds to certain IBM print train conventions.

       One must specify ``conv=noerror,sync'' when copying raw disks with bad sectors to ensure that dd stays synchronized.
       On  SCSI  tape devices when reading a multi-volume tape set the command will exit normally upon hitting EOT on any volume rather than auto-
       matically unloading the volume and prompting for the next volume as is normal. The user should load the next volume and issue  the  command
       anew.

Diagnostics
       f+p records in(out): numbers of full and partial records read(written)

See Also
       cp(1), tr(1), nbuf(4)

																	     dd(1)