9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a variable and assigned the following values
***XYZ_201519_20150929140642_20150929140644_211_0_0_211
I need to read this variable from backward and stop read when I get first underscore (_)
In this scenario I should get 211
Thanks
Kris (3 Replies)
Discussion started by: mkris
3 Replies
2. Shell Programming and Scripting
Hi All,
I have been using a program on windows called AutoKey.
My environment at work is Linux and I have been experimenting with expect. Very powerful. I can move my AutoKey scripts to Linux using Expect once I am educated on how to read from a file using Expect.
My application would be... (1 Reply)
Discussion started by: quemalr
1 Replies
3. UNIX for Dummies Questions & Answers
So, the beginning of my script will cat & grep a file with the output directed to a new file. The data I have in this file needs to be parsed, read and evaluated.
Basically, I need to identify the latest date/time stamp and then calculate whether or not it is within 15 minutes of the current... (1 Reply)
Discussion started by: hynesward
1 Replies
4. Shell Programming and Scripting
Hi,
I have a text file something like this:
10.10.10.1,
ldap,
cn=users,dc=example,dc=com
.....
...
and many more lines
...
...
now i want to read each individual line from the file and assign it to a variable
example:
the script should read 10.10.10.1 and assign it to a variable say... (3 Replies)
Discussion started by: sunrexstar
3 Replies
5. Shell Programming and Scripting
So, I want to read line-by-line a text file with unknown number of files....
So:
a=1
b=1
while ; do
b=`sed -n '$ap' test`
a=`expr $a + 1`
$here do something with b etc
done
the problem is that sed does not seem to recognise the $a, even when trying
sed -n ' $a p'
So, I cannot read... (3 Replies)
Discussion started by: hakermania
3 Replies
6. Shell Programming and Scripting
Hi,
For the text file let us say t.txt having the statements as below.
filename : t.txt.
Contents :
This is first string1
This is first string2
This is first string3
The output of the file should have newline. How to introduce the new line so that the output be as follows
... (5 Replies)
Discussion started by: krackjack
5 Replies
7. Shell Programming and Scripting
Hi,
I am doing :
while read line
do
printf "%s\n" ${line}
done <datafile.txt
but I am not getting each single line from the data file assigned to the variable line (but only tokens/fields at a time). I also tried while IFS= read -r lineI want the whole line assigned or read into the... (2 Replies)
Discussion started by: shri_nath
2 Replies
8. Shell Programming and Scripting
hello,
I have got the following problem that I am hoping someone can help with please.
1. I have got the following text file (below) , the columns data are
'Test Day', 'Board', 'Betting Number'.
TEXT FILE
============================================
1 3 02-01-27-28-29-30
0 1... (1 Reply)
Discussion started by: jermaine4ever
1 Replies
9. Shell Programming and Scripting
Ok. before anyone mentions it, I did search for this but I'm not sure if I am looking for the right thing.
Now, onto my issue.
I have been keeping vmstats output in running text files.
So I have a file that looks like this:
vmstat 2 5
2005.09.19
kthr memory page ... (6 Replies)
Discussion started by: MizzGail
6 Replies