10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
HELLO!!
I'm trying to pass a variable with in the 'sed' command (which would add some piece of code to file at a particular line). We can use
sed '{line-number}a\
alfjaljf\
aslfjsfsjafl\
adlfjaf\' file.txt
If file.txt is
Now, I would like to add the parameter 'lmn' after... (1 Reply)
Discussion started by: mjavalkar
1 Replies
2. Red Hat
Hi,
I heard a command that can collect all RHEL 5 log in a single compress file before I forget.
Does any body know...What the command is ?
Thanks. (4 Replies)
Discussion started by: nnnnnnine
4 Replies
3. Shell Programming and Scripting
Hello, I am a new joiner to the forum, and have what i hope is a simple question, however I can't seem to find the answer so maybe it is not available within bash scripting.
I intend to use the below script to archive files from multiple directories at once by using a loop, and a variable (n)... (10 Replies)
Discussion started by: dring
10 Replies
4. Shell Programming and Scripting
Hi all,
I want write a script to display 5rows at times from a input file.
my out like:
echo " display started"
r1
r2
r3
r4
r5
... Some action items...
again i need next 5 lines.
can you please advise. (2 Replies)
Discussion started by: koti_rama
2 Replies
5. Shell Programming and Scripting
hi guys,
The following command doesn't seem to work in my shell script:
tag=$(sed -n '/${line}/ s/.*\.*/\1/p' myfile.txt)
When i replace the ${line} with an actual value, it works fine.
So, how do i use the ${line} in this sed command?
Thanks in advance,
Zaff (2 Replies)
Discussion started by: zaff
2 Replies
6. Shell Programming and Scripting
Hello,
I have a problem combining two variables into one.
I did the following:
in my env variables i had set
PATH_DESTINATION_1=/root/path_one
PATH_DESTINATION_2=/root/path_two
#!/usr/bin/ksh
count=1
count_path=2
while
do (3 Replies)
Discussion started by: Eraser
3 Replies
7. Shell Programming and Scripting
I can't believe I can't figure this out... given this code:
CARS_DATA_LIST=`cat /tmp/file1 | awk '{print $1}' `
FMSA_DATA_LIST=`cat /tmp/file2 | awk '{print $1}' `
The value of each of the above variables is:
CARS = a b c d e f g
FMSA = a b c q r s
I want to declare a third... (8 Replies)
Discussion started by: Shoeless_Mike
8 Replies
8. Shell Programming and Scripting
I have got a file job_tree.lst , which contains 1 line as below
$ cat job_tree.lst
ABC_D_EQ_XXXXX_YYYY_PRD_UX 05/08/2009 05:47 05/08/2009 05:50 IN 13412850/0
I want to get a child job string 3 characters offset from the parent job string (i.e. ABC_D_EQ_XXXXX_YYYY_PRD_UX 05/08/2009... (4 Replies)
Discussion started by: Armaan_S
4 Replies
9. UNIX for Dummies Questions & Answers
I am trying to write a simple script which will take a variable with sed to take a line out of a text and display it
#!/bin/sh
exec 3<list
while read list<&3
do
echo $list
sed -n '$list p'<list2
done
this does not work, yet when I replace the $list variable from the sed command and... (1 Reply)
Discussion started by: MaestroRage
1 Replies
10. Shell Programming and Scripting
I need to assign a variable within a variable in a sed command.
I tried doing the following in c shell.
set left = 1
set right = 2
set segment = qwerty
sed -n -e "/$segment{$left}/,/$segment{$right}/p" file.txt
what is wrong with this syntax? (3 Replies)
Discussion started by: wxornot
3 Replies