10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I am on Sun os. I have data in the below format and I need to grab the number out from the string.
O/p needed:
---------- Post updated at 12:39 PM ---------- Previous update was at 12:32 PM ----------
I tried this but I am getting . at the front (14 Replies)
Discussion started by: dsravanam
14 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I'm doing a script to list all scripts called by a "master" script.
But I have an issue as there is some variables in the name of the called scripts.
Example:
% cat master_script.sh
ENVIR=PROD
VERSION=1.2
/users/maturix/$ENVIR/program_$VERSION.shI would like my script displays a kind... (7 Replies)
Discussion started by: maturix
7 Replies
3. Shell Programming and Scripting
I have to extract number part (Date and timestamp part ) from the following 3 strings
AB_XYZA_20130930183017.log
AB_DY_XYZA_20130930183017.log
AB_GZU_20130930183017.log
Output should be
20130930183017
Please help me to get the string like above
Thanks (2 Replies)
Discussion started by: smile689
2 Replies
4. Shell Programming and Scripting
I have the following script (which I made by my self)
#!/bin/bash
# add a few empty lines to make it more legible
# add a date description on each update interval
echo "" >> /home/user/DYN_DNS_IP_change.log
echo "" >> /home/user/DYN_DNS_IP_change.log
echo "" >>... (6 Replies)
Discussion started by: mahirzukic2
6 Replies
5. Shell Programming and Scripting
Hi!
I have a file that contains non-regular strings like:
SCSGTI:N="$4,0,1,4,34622991111-->RemoteSPC: 1111", NWID=1;
SCSGTI:N="$4,0,1,4,34622991211-->RemoteSPC: 1211", NWID=1;
SCSGTI:N="$4,0,1,4,*-->RemoteSPC: 2112,Sec:RemoteSPC: 2212", NWID=1;
SCSGTI:N="$4,10,1,4,34622999213-->RemoteSPC:... (4 Replies)
Discussion started by: Flavius
4 Replies
6. Shell Programming and Scripting
I need to extract certain pieces from a string, wher delimiters may vary. For example
A0 B0 C0 12345677 X0 Y0 Z0
A1-B1 C1 12345678 X1 Y0 Z0
A1/B2 C77 12345679 X2 Y0 Z0
I need to get
C0 12345677 X0
C1 12345678 X1
C77 12345679 X2
I tried sed, see example below:
echo 'A0 B0... (2 Replies)
Discussion started by: migurus
2 Replies
7. Shell Programming and Scripting
Hi, guys. I have one question:
I need to search for a string in a file, and then extract another string from the file and assign it to a variable.
For example:
the contents of the file (group) is below:
...
ftp:x:23:
mail:x:34
...
testing:x:2001
sales:x:2002
development:x:2003
...... (6 Replies)
Discussion started by: daikeyang
6 Replies
8. UNIX for Dummies Questions & Answers
Hello,
I have a question regarding the awk command. Here is the line I need to grep:
1 F= -.13250138E+03 E0= -.13249556E+03 d E =-.174650E-01 mag= 35.2157
Instead of displaying the number in red I would like to store it as a variable such as X. Is there a way to do this? Thanks for any... (3 Replies)
Discussion started by: modey3
3 Replies
9. UNIX for Dummies Questions & Answers
Hello,
I'm running calculations and I need to extract a specific number from a output file. So far I've only been able to GREP entire lines containing the string: '1 F=' . I would like to go a step further and extract just the number following '1 F='. The entire line looks like:
1 F=... (10 Replies)
Discussion started by: modey3
10 Replies
10. UNIX for Dummies Questions & Answers
I have a variable which consists of a string like this:
001 aaabc 44 a bbb12
How do I extract each substring, delimited by the spaces, into new variables - one for each substring?
eg var1 will be 001, var2 will be aaabc, var3 will be 44, var4 will be a, etc?
I've come up with this:... (2 Replies)
Discussion started by: Sniper Pixie
2 Replies