10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have a file which has hundred of records with fixed number of fields. In each record there is set of 8 characters which represent the duration of that activity. I want to sum up the duration present in all the records for a report. The problem is the duration changes per record so I... (5 Replies)
Discussion started by: danish0909
5 Replies
2. UNIX for Dummies Questions & Answers
I have a text file where I want to append a column of numbers in ascending orders.
Input:
57 abc
25 def
32 ghi
54 jkl
Output:57 abc
57 abc 1
25 def 2
32 ghi 3
54 jkl 4
How do I go about doing that? Thanks! (11 Replies)
Discussion started by: evelibertine
11 Replies
3. Shell Programming and Scripting
I have a file that looks like below but i need to add the second part to the first meaning in the part where it goes from 14 to 1 in the first column to go to 14 to 15 and the same with the right side going from 2 to 1 to go to 2 to 3. THanks
1 176.587 0.015 C 1
2 57.351 ... (4 Replies)
Discussion started by: olifu02
4 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I have to append 2 files and while appending i need to add a running sequence number (counter ) for each line at the first column.
For e.g. If file x contains details as below.
Tom
Dick
Harry
Charlie
and file y contains
Boston
Newyork
LA
Toledo
Then the new file should... (1 Reply)
Discussion started by: kalyansid
1 Replies
5. Shell Programming and Scripting
I have a Query!
by using command
cat >> file1 we can append data's to a already existing file, Similarly is it possible to append a data to a variable.
Thanks in Advance!! (2 Replies)
Discussion started by: gwgreen1
2 Replies
6. Shell Programming and Scripting
hi
i want to append zeros to a given number ( varying digits). the total length of the output should be 10 digits. For example:
1)input is var=347
output should be NewVar=0000000347
2) input is var=123456
output should be NewVar=0000123456
i am able to acheive this using typeset... (1 Reply)
Discussion started by: somi2yoga
1 Replies
7. Shell Programming and Scripting
Hi,
I would like to know if it's possible to append data into a variable, rather than into a file. Although I can write information into a temporary file in /tmp, I'd rather if possible write into a variable, as I don't like the idea that should my script fail, I'll be polluting the server with... (5 Replies)
Discussion started by: michaeltravisuk
5 Replies
8. Shell Programming and Scripting
Hi
I need to write a script where there the user enters 3 input parameter
variable
number
the program should ask the user left or right
if it is left , the number specified that many spaces should be added to the value in front of the value and saved in the samee variable itself and if it is... (5 Replies)
Discussion started by: viv1
5 Replies
9. Shell Programming and Scripting
Hey, I'm creating a custom useradd script, and I'm giving the option to add secondary groups. Basically what I want to do is ask for the name of the group, you type in the group you want to add, it assigns that group name to the variable $sgroup. Then the scripts asks if you want add another. If... (0 Replies)
Discussion started by: paqman
0 Replies
10. Shell Programming and Scripting
Hi All,
I have a requirement, in which i have to append some spaces to the variable, and then send it to another function.
I am new to the UNIX shell programming. Ultimately the length of the string should be 40 characters.
exp:
Login = "rallapalli" (length = 10)
i have to append 30 spaces to... (2 Replies)
Discussion started by: rallapalli
2 Replies