|
|
Up |
|
|
  |
Author: injam4uinjam4u
Date: Jun 30, 2008 23:58
Hi,
I have the following file
swadmin@tb142:/rangedoms1/working/
CRST_OVERLAY_ENHANCE_Analysis_RNGCTRL_DEV> cat exp_aovr_send_new.dat
0001349000174P00000012D-ATPNB050062184TPNB050063880
0001349000174P60000329C-ATPNB050064199TPNB050064268
Now i need the above file in the below format i.e splitting up of
range character 23 to 25 in each record.
Resulting file
____________________
0001349000174P00000012DTPNB050062184TPNB050063880
0001349000174P00000012CTPNB050062184TPNB050063880
0001349000174P00000012BTPNB050062184TPNB050063880
0001349000174P00000012ATPNB050062184TPNB050063880
0001349000174P60000329CTPNB050064199TPNB050064268
0001349000174P60000329BTPNB050064199TPNB050064268
0001349000174P60000329ATPNB050064199TPNB050064268
|
| |
|
| |
3 Comments |
|
  |
Author: WayneWayne
Date: Jun 30, 2008 20:04
I noticed today that ls with "-i" alone doesn't give
correct inode numbers, when the directory is a mount
point! Here's some output showing the problem:
$ cd /
$ /bin/ls -i
648321 bin 907649 home 162081 misc 842817 proc 1329057 srv 1977377 usr
680737 boot 226913 lib 2463617 mnt 2301537 root 1718049 sys ...
|
| Show full article (1.94Kb) |
|
| |
4 Comments |
|
  |
Author: jaredsubmanjaredsubman
Date: Jun 30, 2008 12:13
I have this:
var="I said ( hello world ) and the world said hello back."
var=${var#*(}
echo ${var%%)*}
which outputs:
hello world
as expected.
However, I am trying to simply turn that into a one-liner which I've
been completely unsuccessful with.
The reason is that it has no significant advantage currently over cut/
awk/sed solutions as the variable is being re-defined. Does anybody
know how I can turn the above into a one-liner?
The following command (and many other variants) do not work:
echo ${var#*(%%)*}
Any help would be much appreciated. Thanks.
|
| |
|
2 Comments |
|
  |
Author: BNBN
Date: Jun 30, 2008 11:27
Greetings,
Version 11/16/88
OS: HP-UX 11.11, AIX 5.3.0.0, SUN OS
Goal is to Page Primary during Mon to Fri between 9 and 5 PM, if not
page on-call.
Time check works fine, one liner doesn't work:
TIME=$(date +%%H)
case $TIME in
01|02|03|04|05|06|07|18|19|20|21|22|23|
00)DBA_PAGER="$ON_CALL_PAGER" ;;
08|09|10|11|12|13|14|15|16|17)DBA_PAGER=$PRIAMRY_PAGER ;;
esac
DNUM=$(date +%%u) # Day Number
(( (DNUM < 6) ? PAGE="ON_CALL" : PAGE="PRIMARY" ))
ksh: (DNUM < 6) ? PAGE=ON_CALL : PAGE=PRIMARY : syntax error
Not sure what am I doing wrong
For now I am using this:
|
| Show full article (0.72Kb) |
|
2 Comments |
|
  |
Author: paulpaul
Date: Jun 30, 2008 07:59
Hello,
i have a basic question, i've made a ksh script under aix 5.3
I'd like to have only one line for the following two lines
print " --> rm -rf $DUMPREPDEST/$BASEDEST" >> $FICHIER_LOG
rm -rf $DUMPREPDEST/$BASEDEST >> $FICHIER_LOG 2>&1
and i don't want to use echo '..... ' | tee | ksh >> $FICHIER_LOG 2>&1
Here an example of a procedure, you see it's very verbose and it's difficult
to read and maintain.
Thanks for any advices
# Suppression/Cr
|
| |
|
3 Comments |
|
  |
Author: un_briceun_brice
Date: Jun 30, 2008 07:39
Hi !
Please excuse my bad English ;-)
My initial problem was to run commands provided by non-trusted users
who do not have a local shell account. I also needed to be able to
stop those commands by a signal.
To do so, I wrote a script which use a pool of unix accounts
hadoop{0...N} and run the user-provided command under one of those
accounts. The script traps signals and kill the process group when it
receive one.
It seems to work. I took my precautions to avoid race-conditions
(using mktemp to create locks), but I'm affraid that their could other
problem which would made this script insecure.
Could you, please, give me an advice on that subject ?
Thanks,
Brice
>>>>>>>>>
#!/usr/bin/env bash
## This script runs insecure scripts in a sandbox provided
## by a pool of local unix accounts
|
| Show full article (2.89Kb) |
|
no comments
|
|
  |
Author: PengYu.UTPengYu.UT
Date: Jun 29, 2008 12:13
Hi,
I try to set the value of a global variable in a function. But the
following way does not work. Would you please let me know what is the
correct way?
Thanks,
Peng
#!/bin/bash
temp=0
my_test() {
globle temp=1
}
echo $temp
|
| |
|
3 Comments |
|
  |
|
|
  |
Author: Steven WoodySteven Woody
Date: Jun 28, 2008 19:40
Hi,
I have couple of c/c++/h files, and I am thinking is there a easy way,
instead of writing a C progream, to find out all lines, in any file,
which are longer than 80 columns.
Thanks.
-
narke
|
| |
|
4 Comments |
|
  |
|
|
  |
Author: JRoughJRough
Date: Jun 27, 2008 13:37
I don't see Perl in my /usr/bin so I can't use mysqlhotcopy so I'm
writing a script for mysqldump. I also need to copy a directory of
html pages. I could use any help. This is as far as I got:
#!/bin/bash
if user = rootUser
mysqldump --user = rootUser --password myDatabase > backup/ backup_&
date & myDatabase.sq
cp public_html/myWebPageDir backup/backup& date & myWebPageDir
else
exit #
I have the error message
"./myBackupScript.sh: line 8: syntax error near unexpected token
`else'
./myBackupScript.sh: line 8: `else'
"
tia,
My problem is
|
| |
|
3 Comments |
|
|
|
|
|
|