10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I like to intersect two files based on their first columns. Here is the code which does the trick for me:
awk 'NR==FNR{A;next}$1 in A' file1 file2
However, this only looks for exact matches between the two files in the first column. I need them to be printed even if part of the string... (10 Replies)
Discussion started by: a_bahreini
10 Replies
2. Shell Programming and Scripting
Hi All,
I have few files named.
abcd.docx
abcde.doc
abcdef.temp
I wish if I could extract the string upto .(dot),and not the extension.
Thanks a lot.
Kind regards,
Indranil. (4 Replies)
Discussion started by: Indra2011
4 Replies
3. Shell Programming and Scripting
i have something like this...
echo "teCertificateId" | awk -F'Id' '{ print $1 }' | awk -F'te' '{ print $2 }'
Certifica
the awk should remove 'te' only if it is present at the start of the string.. anywhere else it should ignore it.
expected output is
Certificate (7 Replies)
Discussion started by: vivek d r
7 Replies
4. Shell Programming and Scripting
Hi
I need to Replace a part of string in between one complete string.
For e.g..
in the file the value is as:
jobnm_$code_xyz_001
In script we are having a variable code=$3, where $3=ab
final output should be jobnm_ab_xyz_001.
But it is not working. Your help will be... (1 Reply)
Discussion started by: vee_789
1 Replies
5. Shell Programming and Scripting
I have a string something like "/opt/src/default.cfg" OR /opt/src/common/one
This whole string stored in an array. The problem is this string is not constant and it will keep on changing as lot of strings are stored in the array and it will be look like :-
case 1
/opt/src/default.cfg ... (8 Replies)
Discussion started by: Renjesh
8 Replies
6. Shell Programming and Scripting
Hi mates,
I am doing a script in ksh. I have the following string:
/opt/one/two/four/five/myFile.txt
And I have a variable:
echo "${variable}" -> /opt/one/two/
I would like to have just the string: four/five/myFile.txt
What is the better way to do that?
Thanks in... (3 Replies)
Discussion started by: gonzaloron
3 Replies
7. Shell Programming and Scripting
Hi,
I have a string assinged to a varaible as below.
FILE=/var/adm/message
If $FILE is the value where it stores the path of message file.
I would like to extract the location of the file message as below
LOCATION=/var/adm
FILE may have value like /var/adm/xxxx/message
... (2 Replies)
Discussion started by: raghu.amilineni
2 Replies
8. UNIX for Dummies Questions & Answers
hi
I have the input as follows
ABC =893
JKL = "jee"
alias PQR = 9833
alias STUVE = "kuiue"
I should be able to print as follows
ABC
JKL
alias PQR
alias STUVE
Thanks
Suresh (7 Replies)
Discussion started by: ssuresh1999
7 Replies
9. Shell Programming and Scripting
Hi all
suppose i have a string "abacus sabre", i need to replace occurences 'ab' with 'cd' and i need to store this result into same string and i need to return this result from script to the calling function, where as the string is passed from calling function.
i tried like this
... (1 Reply)
Discussion started by: veerapureddy
1 Replies
10. Shell Programming and Scripting
Hi,
I wanted to cut a specific portion from given string. How would I do that?
Example:
/u09/core/inbound/abc.txt is my string.
I want abc.txt in a variable.
Please help me.
Regards,
Dhaval (3 Replies)
Discussion started by: dhaval_khamar
3 Replies