10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I have variable named tablename. The value to tablename variable has leading and trailing white spaces. How to remove the leading and training white spaces and write the value of the tablename without space to a file using shell script. ( for e.g. tablename= yyy )
INPUT
... (10 Replies)
Discussion started by: pottic
10 Replies
2. Shell Programming and Scripting
Hello,
I wondering how I can echo a string without having the trailing whitespace removed.
For example I have a string str="TESTING123 " that I need to hash using sha1. I get the correct answer when I run the line below from the terminal
$ echo -n "TESTING123 " | openssl sha1... (3 Replies)
Discussion started by: colinireland
3 Replies
3. UNIX for Dummies Questions & Answers
I want to keep string/varible length to 10 even its actual length is less than 10(may be no value). so, i want to add trailing spaces to my string. :wall:
"typeset -L10 myvarible" is not working, its saying invalid typset -L option.
Can you please advise. (4 Replies)
Discussion started by: djaks111
4 Replies
4. Shell Programming and Scripting
Hi guys,
when I take substring of a particular data using this command
var=substr($0,11,10)
it comes with spaces, when I am trying to trim the spaces it is not allowing me to do that.
Can you please help me out on that.
As I have to reverse the output of the variable also.
---------- Post... (0 Replies)
Discussion started by: manish8484
0 Replies
5. Shell Programming and Scripting
I am getting a value from a csv file using CUT command, however the command extracting the records with trailing spaces. I am using the result into a sql session to fetch data, because of the trailing spaces the sql session is unable to fetch any data.
Please let me know, how to remove this... (2 Replies)
Discussion started by: mady135
2 Replies
6. Shell Programming and Scripting
I know you can remove trialing slashes using:
#echo "/tmp/one/two/three////" | sed "s,/$,,"
/tmp/one/two/three///
But I want to know how to make it remove all trialing flashes in the front, and in the start, so the end result is:
tmp/one/two/three
Anyone have any idea how to do this... (6 Replies)
Discussion started by: EXT3FSCK
6 Replies
7. Shell Programming and Scripting
Hi All
I want to delete trailing zeros from varible.
ex:
if variable value is 1234.567000 result as 1234.567
if variable has 1234.0000 result as 1234
if variable as abcd.fgh result as abcd.fgh
Can somone give me a solution using awk? (16 Replies)
Discussion started by: Chandu2u
16 Replies
8. UNIX for Dummies Questions & Answers
when I execute a command in like "run.sh," I can run it two ways:
./run.sh
or
. run.sh
What is the difference? (1 Reply)
Discussion started by: DarkLord
1 Replies
9. Solaris
Hi my lovely friends,
Im writing one pgm in which i trying to assign some values like
$var='Jun 6'
but if i do echo of this $var will trim the spaces expect one space.
$echo $var
$Jun 6
But if var='Jun 28', then this will works fine
$echo $var
$Jun 28
this is required to exctract... (2 Replies)
Discussion started by: Lokesha
2 Replies
10. Shell Programming and Scripting
I am trying to strip all leading and trailing spaces of a shell variable using either awk or sed or any other utility, however unscuccessful and need your help.
echo $SH_VAR | command_line Syntax.
The SH_VAR contains embedded spaces which needs to be preserved. I need only for the leading and... (6 Replies)
Discussion started by: jerardfjay
6 Replies