10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi. I'm getting the following hidden characters \uat the start of a string after I pass in variables from the command line. I only noticed this when I set -x in my KSH script. Can anybody tell me how this happens and how to remove them?
Many thanks.
+ STR=$'\uusername testuser1'
+ print... (12 Replies)
Discussion started by: user052009
12 Replies
2. Shell Programming and Scripting
Hi All,
I am trying to find non-printable characters in a string. The sting could have alphanumeric, puntuations and characters like (*&%$#.') but not non-printable (or that is what I think they are called) which are introduced when you copy any text from DOS to unix box.
Input string1:... (10 Replies)
Discussion started by: dips_ag
10 Replies
3. Shell Programming and Scripting
Hi Guys,
I came across a scenario where I have to check the starting character of line in a file.
if it is a specile character i.e. "<" gretaer then perform action.
I tried serval ways but could not get the work done.
Please help me ....
Thanks (6 Replies)
Discussion started by: ravi111_07
6 Replies
4. Shell Programming and Scripting
Hi,
i want to use awk to print the first 6 characters of a variable
awk -F"|" '$3>0 { print $3 }' z00.unl > z001.unl
but $3= 7 digits
and i just want to print the first 6 digits.
eg 1005779 but i want to print only 100577 (3 Replies)
Discussion started by: dealerso
3 Replies
5. Shell Programming and Scripting
Hi All,
I have a requirement to read a line from a file with some search string, replace any backslash characters in that line and store in a variable.
Shell script: replace.ksh
#!/bin/bash
file2=input.rtf
line=`grep "Invoice Number" ${file2} | head -1 | sed 's/\\//g'`
echo "start... (6 Replies)
Discussion started by: prashas_d
6 Replies
6. Shell Programming and Scripting
Hey,
I'm trying to print the first four characters of the hostname of a computer.
I can get it from using:
hostname -s | sed 's/...........$//'"
but this is when I know how many characters are in the computer name.
I dont understand why some like:
hostname -s | sed '/..../p'
wont... (7 Replies)
Discussion started by: yxian
7 Replies
7. Shell Programming and Scripting
suppose
fileA
kanika123ABC 1222222222222222
raciat5678ty 1221123333331121
jessica78ulllo 2233243223333333
so output shud be print only first 10 characters in series and rest remain same
kanika123A 1222222222222222
raciat5678 1221123333331121
jessica78u ... (1 Reply)
Discussion started by: cdfd123
1 Replies
8. Shell Programming and Scripting
Hi,
Here the way the txt file looks like..
100|abcd|6899|xyz
112|dlkja|79311|
432|adjkl|1348|iaw
I need the last characters after the last '|' ..
thanks (5 Replies)
Discussion started by: meghana
5 Replies
9. UNIX for Dummies Questions & Answers
How could I check if a string variable contains at least (or only) 2 characters, and check and make sure that the string does not contain any numeric digits?...I need to know how to do this as simple as possible. and I am using the Ksh shell. Thanks. (1 Reply)
Discussion started by: developncode
1 Replies
10. Shell Programming and Scripting
Hi,
How can I split the characters in a word?
For Eg:
If my input is:
command
my output should be:
c
o
m
m
a
n
d
Please help me in doing it so. (5 Replies)
Discussion started by: chella
5 Replies