10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I need to extract part of a text to two variables
text is
"PL/SQL procedure successfully completed. ERROR ----------------------------------------------------------------- Test Error Message PLUSVAR ---------- 1"
I want "Test Error Message" in one variable and "1" in another variable.... (11 Replies)
Discussion started by: vedavrath
11 Replies
2. Shell Programming and Scripting
I am running AIX 5.3 using the Korn Shell. I am reading file names from a file, as an example:
E0801260
E0824349
E0925345
EMPMSTR
statement "num=$(expr substr "$DDNAME" 4 2)
extracts the numeric values fine. But when I het the last entry, it returns num=MS, but I get an error... (19 Replies)
Discussion started by: kafkaf55
19 Replies
3. Shell Programming and Scripting
Shell Scripting Gurus,
I am having a hard time :confused: trying to figure out what I am doing wrong in my script. Below is the script snippet. It gives an error when it tries to execute the expression.
a=`expr substr $stringZ 5 10`
#!/bin/bash
echo "Hello"
stringZ="abcABC123ABCabc"... (3 Replies)
Discussion started by: yajaykumar
3 Replies
4. Shell Programming and Scripting
I'm writing a shell script in which I need to be able to pull a portion of the file name out. I'm testing with the following code:
x="O1164885.DAT"
y=`ls -ltr *${x}|awk '{print substr($0,3)}'`
echo ${x}|awk '{print substr($0,3)}'
echo "y="$y
I can echo it to the screen just fine but I... (3 Replies)
Discussion started by: ttunell
3 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I have two text files containing records in following format:
file1 format is:
name1 age1 nickname1 path1
name2 age2 nickname2 path2
file 1 example is:
abcd 13 abcd.13 /home/temp/abcd.13
efgh 15 efgh.15 /home/temp/new/efgh.15 (4 Replies)
Discussion started by: alrinno
4 Replies
6. Shell Programming and Scripting
As per title and much apprecieated! (2 Replies)
Discussion started by: biglau
2 Replies
7. Shell Programming and Scripting
hi,
i am using the following script to get the last digit of YEAR
OY=`expr substr $YEAR 2 1`
it is showing syntax
Is this wrong or i need to change anything
I am running this in sun solaris unix (7 Replies)
Discussion started by: gjithin
7 Replies
8. Shell Programming and Scripting
I am modifying a Korn shell script in using the Exceed (Solaris 10 environment). My task is to read in a .txt file with dates arranged like this (01-Sep-2006). I am to read each line and take the dates, compare them to a benchmark date and depending on if it is older than the date or the date and... (6 Replies)
Discussion started by: mastachef
6 Replies
9. Shell Programming and Scripting
Hi,
I'm a newbie to UNIX scripting and I'm having some trouble compiling my script. I'm using the Bourne Shell and cannot seem to use the substr function correctly. I'm trying to extract the last two digits of a year that's stored in a variable based off of a condition. I've searched the... (4 Replies)
Discussion started by: E2004
4 Replies
10. Shell Programming and Scripting
Hi,
I have two files with the following content:
gmrd.txt
235649;03;2563;598
291802;00;2563;598
314634;00;235649;598
235649;03;2563;598
393692;00;2563;598
411805;00;2563;598
411805;00;2563;598
235649;03;2563;598
414037;00;2563;598
575200;00;2563;598
70710;00;2563;598... (11 Replies)
Discussion started by: penfold
11 Replies