10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have a XML file where there is a tag with like
<wd:address_line_1>1234 Street</wd:address_line_1>
I want to replace the values "1234 Street" with "Test Data". Different people have different address lines and i want to replace with a fixed value to mask the file. I was trying to use sed... (7 Replies)
Discussion started by: dr46014
7 Replies
2. Shell Programming and Scripting
On linux i have the below command working fine.
awk '/<app-deploy>/{A=1;++i} /<\/app-deploy>/{print >> "found"i".tmp";A=0} A{;print >> "found"i".tmp"}' deploy.xml
But the same is failing on Solaris
Output:
awk: syntax error near line 1
awk: bailing out near line 1
uname -a SunOS mymac 5.10... (5 Replies)
Discussion started by: mohtashims
5 Replies
3. Shell Programming and Scripting
# check host value regex='^(||1|2|25)(\.(||1|2|25)){3}$' if ')" != "" ]; then if ]; then echo host $host not found exit 4 fi elif ]; then echo $host is an invalid host address exit 5 fi (1 Reply)
Discussion started by: kevin298
1 Replies
4. UNIX for Advanced & Expert Users
Using awk variables for regular expressions is working for me in AIX. It is failing for me in SunOS. I don't know why. Can someone explain and/or suggest a fix for the SunOS version?
Here is a little test script. It runs fine in AIX:
$ cat test.ksh
#! /bin/ksh
print "Executed on OS: $(... (6 Replies)
Discussion started by: charles_n_may
6 Replies
5. Shell Programming and Scripting
Hi All,
I have a sftp session log where I am transferring multi files by issuing "mput abc*.dat". The contents of the logfile is below -
#################################################
Connecting to 10.75.112.194...
Changing to: /home/dasd9x/testing1
sftp> mput abc*.dat
Uploading... (7 Replies)
Discussion started by: k_bijitesh
7 Replies
6. Shell Programming and Scripting
Hello,
Could someone explain why this one returns nothing:
$ x=/jon/
$ echo jon | awk -v xa=$x '$1~xa {print}'
$
while the following works fine:
$ x=jon
$ echo jon | awk -v xa=$x '$1==xa {print}'
$ jon
and the following works fine:
$ echo jon | awk '$1~/jon/ {print}'
$ jon
... (3 Replies)
Discussion started by: vilius
3 Replies
7. Shell Programming and Scripting
Hello,
I found this command works on Linux:
$ echo `uptime` | awk -F "load average: " '{ print $2 }'
1.60, 1.53, 1.46
but got error on Solaris:
$ echo `uptime` | awk -F "load average: " '{ print $2 }'
awk: syntax error near line 1
awk: bailing out near line 1
$ which awk... (2 Replies)
Discussion started by: seafan
2 Replies
8. Shell Programming and Scripting
I am trying to grep the following line in a file using a bash shell:
(..)
admin1::14959::::::
(..)
It works with the following expression (as expected)
# cat file | grep ^*::
admin1::14959::::::
but it does not work with (not expected)
# cat /etc/shadow | grep ^+::
I assume the... (2 Replies)
Discussion started by: schms
2 Replies
9. Shell Programming and Scripting
Good morning all!!
In my code I and looking through file /etc/syslog.congf and printing every line that has /var/log in it. I need to turn the if 9$line) into a regex code instead.
#!/usr/bin/perl
@file= 'cat /etc/syslog.conf'; //when
foreach $line (@file){
if ($line =~... (3 Replies)
Discussion started by: bigben1220
3 Replies
10. Shell Programming and Scripting
I want to block all special characters except alphanumerics.. and "."(dot ) character
currently am using //
I want to even block only single dot or multiple dots..
ex:
. or .............. should be blocked.
please provide me the reg ex.
---------- Post updated at 05:11 AM... (10 Replies)
Discussion started by: shams11
10 Replies