05-22-2009
Thanks canbridge.
Infact I cant use perl inside the script.
If I want the output as
sys,systematic,bigredhat\HI
where bigredhat is the system name obtained by uname -n.
what modifications need to be done in ur awk example?
Thanks
friendyboy
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am new to using Sed. I have a file containg lines like the following:
INFORM----Test.pc:168:10/11/05 12:34:26 > some text goes here..
TRACE-----Test.pc:197:10/11/05 12:34:26 > some text goes here..
My requirement is to replace 10/11/05 12:34:26 with a string <RUNDATE> (including <... (4 Replies)
Discussion started by: Hema_M
4 Replies
2. Shell Programming and Scripting
Hi guys, I hope you can help me with my problem.
I have a text file that contains lines like this:
78 ANGELO -809.05
79 ANGELO2 -5,000.06
I need to find all occurences of amounts that are negative and replace them with x's
78 ANGELO xxxxxxx
79... (4 Replies)
Discussion started by: amangeles
4 Replies
3. Shell Programming and Scripting
I have three files that the string inside it I want to replace
so my code will be
#!/bin/bash
read -p "please input the old string:" string1
read -p "please input the new string:" string2
sed -i "s/string1/string2/g" *.c
but the problem is.. the string that I want to replace can't be... (2 Replies)
Discussion started by: Viken
2 Replies
4. Shell Programming and Scripting
Hi,
I have a file with the path of the directory present somewhere in it.I have assigned the path of the directory name to a variable. I want to replace it with another string.The code i used was
sed -e '/$variable/sbcd/' filename.
since the path name includes slashes '/', my sed command... (9 Replies)
Discussion started by: ragavhere
9 Replies
5. UNIX for Dummies Questions & Answers
Hi all,
I have a script which uses sed to replace one string with another. The problem is, the string to be matched, and its replacement are coming in as two command line arguments $1 and $2
$1 and $2 can be absolutely anything, but both should be treated purely as strings. My sed command... (1 Reply)
Discussion started by: mark007
1 Replies
6. Shell Programming and Scripting
Hi all,
I have a script which uses sed to replace one string with another. The problem is, the string to be matched, and its replacement are coming in as two command line arguments $1 and $2
$1 and $2 can be absolutely anything, but both should be treated purely as strings. My sed command... (7 Replies)
Discussion started by: mark007
7 Replies
7. Shell Programming and Scripting
hi,
when i am doing the following things getting error
Can anyone please suggest
i have a file where there is a line like the following
branch=dev sdf dev jin kilii fin kale boyle dev james dev
i want to search the existance of dev in the above line.
cat "$file" | sed -n... (8 Replies)
Discussion started by: millan
8 Replies
8. Shell Programming and Scripting
Hi all,
Sed is the one which always trobules me :(
here is my input :
*** it industry need to be evolved *** in the world and hope so *** to be dream
the output i am expecting is :
*** it industry need to be evolved
*** in the world and hope so
*** to be dream
... (4 Replies)
Discussion started by: panyam
4 Replies
9. Shell Programming and Scripting
If the string is of the pattern XxxXyzAbc...
The expected out put from sed has to be Xxx Xyz Abc ...
eg: if the string is QcfEfQfs, then the expected output is Qcf Ef Efs.
If i try to substitute the pattern with space then the sed will replace the character or pattern with space,... (1 Reply)
Discussion started by: frozensmilz
1 Replies
10. Shell Programming and Scripting
My need is :
Want to change
docBase="/something/something/something"
to
docBase="/only/this/path/for/all/files"
I have some (about 250 files)xml files.
In FileOne it contains
<Context path="/PPP" displayName="PPP" docBase="/home/me/documents" reloadable="true" crossContext="true">... (1 Reply)
Discussion started by: linuxadmin
1 Replies
UNAME(3) BSD Library Functions Manual UNAME(3)
NAME
uname -- get system identification
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/utsname.h>
int
uname(struct utsname *name);
DESCRIPTION
The uname() function stores nul-terminated strings of information identifying the current system into the structure referenced by name.
The utsname structure is defined in the <sys/utsname.h> header file, and contains the following members:
sysname Name of the operating system implementation.
nodename Network name of this machine.
release Release level of the operating system.
version Version level of the operating system.
machine Machine hardware platform.
RETURN VALUES
The uname() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate
the error.
ERRORS
The uname() function may fail and set errno for any of the errors specified for the library functions sysctl(3).
SEE ALSO
uname(1), sysctl(3)
STANDARDS
The uname() function conforms to IEEE Std 1003.1-1988 (``POSIX.1'').
HISTORY
The uname() function first appeared in 4.4BSD.
BSD
January 4, 1994 BSD