9 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have below code inside my awk script
if ( $0 ~ /SVC IN:/ )
{
svc_in=substr( $0,23 , 3);
if (msg_start == 1 && msg_end == 0)
{
msg_arr=$0;
}
}
else if ( $0 ~ /^SVC OUT:/ )
{
svc_out=substr( $0, 9, 3);
if (msg_start == 1 && msg_end == 0)
... (6 Replies)
Discussion started by: bhagya123
6 Replies
2. UNIX for Dummies Questions & Answers
In a SCO Unix shop, I am working on the following script to move any file to its same location on the target machine (called 'othersy' here):
pwd=`pwd`
for i in "$@"
do
echo " $i "
if ; then echo 1; else echo 0; fi
rcp -p $i othersy:$pwd/$i
echo "Finished with ^ If I find a file... (4 Replies)
Discussion started by: wbport
4 Replies
3. Shell Programming and Scripting
Hello I have two vars loaded with
$VAR1="ISOMETHING103"
$VAR2="COTHERTHING04"
I need to:
1) Strip the first char. Could be sed 's/^.//'
2) The number has it's rules. If it has "hundreds", it needs to be striped.
If it is just two digits it shouldn't.
So, for VAR1 output should be... (7 Replies)
Discussion started by: tristezo2k
7 Replies
4. Shell Programming and Scripting
Hi all,
Given a file name such as
EXAMPLE=lastname-02.30.71-firstname-town-other.tar.gz
How do I print everything before the first dash (i.e. lastname)
Note: I do not know exactly how many dashes or what information there will be in each file name so it is important that the code... (2 Replies)
Discussion started by: bashnewbee
2 Replies
5. UNIX for Dummies Questions & Answers
HI
In my script, i am reading the input from the user and want to find the length of the string.
The input may contain leading spaces. Right now, when leading spaces are there, they are not counted.
Kindly help me
My script is like below. I am using the ksh.
#!/usr/bin/ksh
echo... (2 Replies)
Discussion started by: dayamatrix
2 Replies
6. Shell Programming and Scripting
I need a way to build variable in this manner:
variable_$i
Inside a for loop i need to create it.
where i goes from 1 to 30..
and then i need to print them on screen with echo $variable_$i
which is the best way to do this? (6 Replies)
Discussion started by: sreedivia
6 Replies
7. UNIX for Dummies Questions & Answers
Hello
I have this string
XYZ-ABC
DFT-ERT
QWE-TYU
I want to get the part after the dash. how to do that?
thanks (2 Replies)
Discussion started by: melanie_pfefer
2 Replies
8. UNIX for Dummies Questions & Answers
I would like to know how to trim leading zero only in certain column of of a string, example:
hdhshdhdhd000012mmmm0002abc <===== before
hdhshdhdhd 12mmmm 2abc <===== after
Thanks for your help. (2 Replies)
Discussion started by: dngo
2 Replies
9. UNIX for Advanced & Expert Users
Somehow someone created a file named '-ov' in the root directory.
Given the name, the how was probably the result of some cpio command they bozo'ed.
I've tried a number of different ways to get rid of it using * and ? wildcards, '\' escape patterns etc.. They all fail with " illegal option --... (3 Replies)
Discussion started by: GSalisbury
3 Replies