comp.unix.shell
  Home FAQ Contact Sign in
comp.unix.shell only
 
Advanced search
June 2008
motuwethfrsasuw
      1 22
2345678 23
9101112131415 24
16171819202122 25
23242526272829 26
30       27
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.unix.shell Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Need Shell Script help         


Author: injam4u
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
  Gnu ls bug?         


Author: Wayne
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
  bash script to display words in parentheses         


Author: jaredsubman
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
  ksh 88 (( expression1 ? expression2 : expression 3 )) - Help Please         


Author: BN
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
  Simplifying the script         


Author: paul
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
  Wrote a script to insulate commands, would like to be sure it's secure         


Author: un_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
  Set global variable in a function (bash)         


Author: PengYu.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
  Hot mangas:Naruto 406, One Piece 505, Bleach 328         


Author: mangaboy001
Date: Jun 29, 2008 02:18

Hot mangas:Naruto 406, One Piece 505, Bleach 328

The hottest mangas and the latest chapters

Manga news, Most popular mangas, Latest mangas, Latest chapters

http://english1.isoshu.com/?recommid=1023

http://emanga1.isoshu.com/?recommid=1023

A New Wonderful Manga: Maken-ki!

http://english1.isoshu.com/search/Maken-ki/all-1?recommid=1023

Hi, my friends!!! Have you read the manga named Maken-ki? This manga
series is as nice as To-Love-ru!!! The illustrator is Hiromitsu
Takeda
and his girls are incredibly gorgeous.

The story is described as an "ecchi love comedy with battle action."
Oyama Takeshi happily enrolls in a co-ed school that didn't required
any entrance exams and has hostels to book... Only to find out that
there's more to the school than he thought!
Show full article (1.34Kb)
no comments
  Find lines in many files longer thant 80 column         


Author: Steven 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
  backup script for a hosted MySQL database         


Author: JRough
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
1 2 3 4 5 6 7 8 9