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
Hi,
I am able to increment numbers but unable to increment the charters in unix -AIX.
Source : AAA BB CCC
Increment Number : 5
OUTPUT:
AAA BB CCC
AAA BB CCD
AAA BB CCE
AAA BB CCF
AAA BB CCG
Thanks
onesuri
Please use CODE tags as required by the forum rules. I have made a wild... (5 Replies)
Discussion started by: onesuri
5 Replies
3. Shell Programming and Scripting
Hi All,
I am new to this forum and a novice at shell script. I am trying to write a script to determine each of the NIC configured on a linux system and its speed and Duplex. I came up with the following piece of code:
echo `ifconfig -a | grep eth > /home/a/nic.txt`
i=`awk -F, '{print... (4 Replies)
Discussion started by: pravin883
4 Replies
4. Shell Programming and Scripting
Hi am using unix aix
I have tried using awk but am getting only output = x ,its not incrementing next output
set -A var1 vv qa za
ct=0
i=3
while
do
var1=`echo ${var1}`
count=`awk ' NR==$i++ {print;exit}' ${.txt} | cut -c5 `
echo $count
let ct=ct+1
done (6 Replies)
Discussion started by: Venkatesh1
6 Replies
5. Shell Programming and Scripting
Hello,
I have a text file withe some records
20121031|5
20121030|3
20121029|1
20121028|4
20121027|6
I want to search for a patten with '20121030' and then increment the second part of the delimiter i.e. 3 by 1 to make it 4 to look like
20121031|5
20121030|4
20121029|1
20121028|4... (7 Replies)
Discussion started by: pparthiv
7 Replies
6. 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
7. Shell Programming and Scripting
Hello, let's say I have this string:
string1="A\nB\nC D E\nFG\nH";
How can I split it so as to take every string separated with '\n' separately?
For example, as for $string1, it would be split into
string1_part1="A"
string1_part2="B"
string1_part3="C D E"
string1_part4="FG"... (5 Replies)
Discussion started by: hakermania
5 Replies
8. 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
9. 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
10. 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