Sponsored Content
Homework and Emergencies Homework & Coursework Questions how can i pass the conv=ucase and conv=lcase in bash script? Post 302605210 by amneytia1 on Wednesday 7th of March 2012 02:00:51 AM
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...
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
conv(3) 						     Library Functions Manual							   conv(3)

Name
       toupper, tolower, _toupper, _tolower, toascii - translate characters

Syntax
       #include <ctype.h>

       int toupper(c)
       int c;

       int tolower(c)
       int c;

       int _toupper(c)
       int c;

       int _tolower(c)
       int c;

       int toascii(c)
       int c;

Description
       The  functions  and  have  as their domain the range of the function. If the argument to represents a lowercase letter, the output from the
       function is the corresponding uppercase letter. If the argument to represents an uppercase letter, the result is the  corresponding  lower-
       case letter.

       The  case  of  c depends on the definition of the character in the language database. Because the case of a character can vary between lan-
       guage databases, the case of c depends on what language database is in use. Specifically, the case of arguments depends	on  what  property
       tables  are  associated the LC_CTYPE category.  Property tables are associated with the LC_CTYPE category by a successful call to the func-
       tion that includes the LC_CTYPE category. If no successful call to define LC_CTYPE has occurred or if the  character  case  information	is
       unavailable for the language in use, the rules of the ASCII coded character set determine the case of arguments.

       If  the	argument  to the function does not have the uppercase attribute, returns the argument unchanged.  Likewise, if the argument to the
       function does not have the lowercase attribute, returns it unchanged.

       The macros and have the same affect as and The difference is that the argument to the macros must be an ASCII character (that is, a charac-
       ter in the domain -1 to 127) and the argument must have the appropriate case.  Arguments to must have the uppercase attribute and arguments
       to must the lowercase attribute. The result of supplying arguments to these macros that are outside the domain or do not have the appropri-
       ate case is undefined.  These macros operate faster than the and functions.

       The  macro  converts its argument to the ASCII character set. The macro converts its argument by truncating the numerical representation of
       the argument so that it is between -1 and 127. You can use this macro when you move an application to a system other than an ULTRIX system.

   International Environment
       LC_CTYPE       If this environment variable is set and valid, uses the international language database named in the definition to determine
		      character classification rules.

See Also
       ctype(3int), setlocale(3), getc(3)

																	   conv(3)
All times are GMT -4. The time now is 09:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy