10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Trying to find and replace one string with another string in a file
#!/usr/bin/perl
$csd_table_path = "/file.ntab";
$find_str = '--bundle_type=021';
$repl_str = '--bundle_type=021 --target=/dev/disk1s2';
if( system("/usr/bin/perl -p -i -e 's/$find_str/$repl_str/' $csd_table_path")... (2 Replies)
Discussion started by: cillmor
2 Replies
2. Shell Programming and Scripting
I'm probably just not thinking of the correct term to search for :-) But I want to match a pattern that might be 'ABC' or '1ABC' there might be three characters, or there might be four, but if there are four, the first has to be 1 (1 Reply)
Discussion started by: jnojr
1 Replies
3. UNIX and Linux Applications
There is a linux server in my team where everyone is using xterm to connect to the server and work.
Problem is I'm unable to find the ipaddress of the xterm user. It just shows the display as "localhost".
example:
st_capuk@MGTS5026-13sh1:~> ps -eaf | grep xterm
1010 9328 9327 0 May07 ?... (2 Replies)
Discussion started by: Arun_Linux
2 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I'm curious about how to do a very simple thing with regular expressions that I'm unable to figure out.
If I want to find out if a string contains 'a' AND 'b' AND 'c' it can be very easily done with grep:
echo $STRING|grep a|grep b|grep c
but, how would you do that in a single... (9 Replies)
Discussion started by: jimcanoa
9 Replies
5. Shell Programming and Scripting
Hi,
I searched in the forums, but I didn't find a good solution. My problem is:
I have a string like "TEST.ABC201005.MONTHLY.D101010203".
I just want to have the string until the D100430, so that the string should look like: "TEST.ABC201005.MONTHLY.D"
The last characters after the D can be... (8 Replies)
Discussion started by: elifchen
8 Replies
6. UNIX for Dummies Questions & Answers
i am totally confused now, when I use find command, why it does not take the regular express as filename?
for example, i want to find out anything include word "chapter" in their file names, and i used the below command
find / -name ".*chapter.*"
and the system gives me nothing, although... (2 Replies)
Discussion started by: fedora
2 Replies
7. Shell Programming and Scripting
Hi all,
I have one question regarding sed regexp (or any regexp in general),
I have some path like this
C:/Abc/def/ghi/jkl in a file file1
Now if i use following code
cat file1 | sed 's#\(.*\)/.*#\1#'
Now it give me following output
C:/Abc/def/ghi, which is fine
But i just... (2 Replies)
Discussion started by: sarbjit
2 Replies
8. UNIX for Dummies Questions & Answers
Hi Friends,
I am new to UNIX. I wonder how can I get the ipaddress of my machine? In windows, i can use ipconfig to get my ipaddress. I am aware of ifconfig but it does not give the ipaddress.:)
Thanks and regards,
Dinesh Venkatesan. (4 Replies)
Discussion started by: DineshV
4 Replies
9. Shell Programming and Scripting
Hi everybody
for file in *
#Bash performs filename expansion
#+ on expressions that globbing recognizes.
do
output="`grep -n "$1" "$file"`"
echo "$file: `expr "$output" : '\(^.*$\)'`"
done
In the above bash script segment, I try to print just the first line of string named... (3 Replies)
Discussion started by: jonas.gabriel
3 Replies
10. HP-UX
Hi,
Pls tell me any command in Hp-unix to find out the machine ipaddress
Thanks,
shruti (14 Replies)
Discussion started by: shruti_mgp
14 Replies