How to find that a given variable is a number or character?
e.g.
echo "Enter the number"
read var
If "$var" is a number then display "Number has been entered"
else display "Character has been entered".
Thanking you in advance (3 Replies)
hi,
I'm trying to create a program that will read a file and then check the file for each letter of the alphabet and then output the letter and the number of times it appears in the file, into a new file... this is what i have so far but it's not working.. if anyone could help that would be nice!... (10 Replies)
how can i check whether variable contains only character from a-z or A-Z....if my variable contains any alpha numeric, numeric or any character with some special one i.e. *%&@! etcetera etcetera....then it should show me please enter only characters......
Let my variable
var1="abc77}|"
then... (9 Replies)
i am a newbie to shell script,so i want a kshell script in which i need to check for a particular character inside a file through conditional looping(like if ,case,while)and if that character exists ,then substitute a given character to that character.
consider a file test.txt,inside the file... (1 Reply)
Hi,
I have a variable and to it always alphanumeric value will be assigned.
If the value has any special characters in it then in the if statement it should exit like below
if (value has any speacial character)
then
exit
else
....
fi
can any one suggest how to acheive this? (4 Replies)
Hello,
I have a text file with n lines in the following format (9 column fields):
Example:
contig00012 149606 G C 49 68 60 18 c$cccccacccccccccc^c
I need to count the number of lower-case and upper-case occurences in column 9, respectively, of the... (3 Replies)
Hi,
Please see the below information.
1. Read files one by one and run the script.
2. Check if the filename is CHARTER OR NUMBER
3. Run the case statement.
I have files in the folder. i will get 300 files in a single day.
Abc_111111111111.csv
101010_kkk_bbbb.csv... (6 Replies)
Hello,
I have to find out whether the last character is digit or alphabet. I manage to strip the last character but would need some help if there is one liner available to test the above.
set x = WM
echo $x | sed 's/.*\(.$\)/\1/'
O/P
M
I would like a one liner code to test whether the... (1 Reply)
Discussion started by: dixits
1 Replies
LEARN ABOUT SUSE
base64
BASE64(1) User Commands BASE64(1)NAME
base64 - base64 encode/decode data and print to standard output
SYNOPSIS
base64 [OPTION]... [FILE]
DESCRIPTION
Base64 encode or decode FILE, or standard input, to standard output.
-w, --wrap=COLS
Wrap encoded lines after COLS character (default 76). Use 0 to disable line wrapping.
-d, --decode
Decode data.
-i, --ignore-garbage
When decoding, ignore non-alphabet characters.
--help Display this help and exit.
--version
Output version information and exit.
With no FILE, or when FILE is -, read standard input.
The data are encoded as described for the base64 alphabet in RFC 3548. When decoding, the input may contain newlines in addition to the
bytes of the formal base64 alphabet. Use --ignore-garbage to attempt to recover from any other non-alphabet bytes in the encoded stream.
AUTHOR
Written by Simon Josefsson.
REPORTING BUGS
Report base64 bugs to bug-coreutils@gnu.org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
COPYRIGHT
Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
The full documentation for base64 is maintained as a Texinfo manual. If the info and base64 programs are properly installed at your site,
the command
info coreutils 'base64 invocation'
should give you access to the complete manual.
GNU coreutils 7.1 July 2010 BASE64(1)