10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have the string:
XXXX.YYYY_ZZZ.20180724.01.txt
I need to get rid of .txt and get full four parts
XXXX.YYYY_ZZZ.20180724.01
I did:
CTL=`echo XXXX.YYYY_ZZZ.20180724.01.txt | rev | cut -d"." -f4 | rev`
But got only YYYY_ZZZ
What should I do to get all four parts of that... (4 Replies)
Discussion started by: digioleg54
4 Replies
2. Shell Programming and Scripting
I have a string like below
Note: I have have a single to any number of comma "," seperated string assigned to jdbc_trgt variable.
I need to split jdbc_trgt using comma(,) as the delimiter.
I tried the below but it fails as i dont know how can i read each split string iterately.
for... (4 Replies)
Discussion started by: mohtashims
4 Replies
3. Shell Programming and Scripting
Hi there,
I have an output from a command like this
# ypcat -k netgroup.byuser| grep steven
steven.* users_main,users_sysadmin,users_global,users_backup_team
and wanted to pull the 'users' netgroups returned into a perl array, that will look like this
users_main... (2 Replies)
Discussion started by: rethink
2 Replies
4. UNIX for Dummies Questions & Answers
I know how to do produce this:
string01
string02
string03
several different ways.
But how do I do produce this (without getting lost in recursion):
string01morestring100yetmore10
string02morestring101yetmore20
string03morestring102yetmore30
...... (2 Replies)
Discussion started by: uiop44
2 Replies
5. UNIX for Dummies Questions & Answers
hi everybody..
I have a string like :
abcd:efgh
xxyy:yyxx
ssddf:kjlioi
ghtyu:jkksk
nhjkk:heuiiue
please tell me how i can display only the characters after ":" in the output
the output should be :
efgh
yyxx
kjlioi
jkksk
heuiiue
please give quick reply.. its urgent..!! (6 Replies)
Discussion started by: adityamitra
6 Replies
6. UNIX for Advanced & Expert Users
I have a script in a directory and want to search the directory before like follows:
i=0
for file in ../HN_*
do
echo $file
((i+=1))
echo $i
done
Currently I get following output:
../HN_2
1
../HN_3
2 (2 Replies)
Discussion started by: ABE2202
2 Replies
7. Shell Programming and Scripting
How do you truncate specific parts of a string.
Example:
1 This is the string
Goal:
This is the string
As you can see I'm trying to simply remove the first two characters of the string the number one and the space between the one and the word "this."
Your help is appreciated.
... (8 Replies)
Discussion started by: royarellano
8 Replies
8. Shell Programming and Scripting
Hello all, I am having a problem with awk's string split function.
I have a string that has a number at the end, I am trying to remove the alpha portion of the string and just have the numeric part. Here is my code and the result:
BEGIN {
word = "$category121";
split(word, a, 121)
print... (2 Replies)
Discussion started by: RobertSubnet
2 Replies
9. Shell Programming and Scripting
Hi,
My knowledge about sed is limited but I have a problem that I think can be solved with sed.
I have a variable in a shell script that stores a lot of path/filenames and the delimitter between them is a space (they all exist on the same line). One part of the filename is the file creation... (4 Replies)
Discussion started by: pcrs
4 Replies
10. Shell Programming and Scripting
Hi there
With shell script I'm trying to split the string into two parts. One is alphanumeric part, the other one is a numeric part.
dummy_postcode_1 = 'SL1'
--> res_alpha = 'SL' and res_numeric = '1'
dummy_postcode_2 = 'S053'
--> res_alpha = 'S' and res_numeric = '053' ... (1 Reply)
Discussion started by: ozgurgul
1 Replies