Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: jpprial
7,624
Posted By jpprial
yes, your code is better, but my system didn't...
yes, your code is better, but my system didn't like the substitution in the path, cd /top/${db_name##*:}/apps/log. The system is AIX, and I am forced to use the Korn shell, that's the only one that...
7,624
Posted By jpprial
thanks everyone, I took a piece of this and that,...
thanks everyone, I took a piece of this and that, and ended up with a working script:


db2 "get instance" > /tmp/answer$$
grep db2q /tmp/answer$$ 1> /dev/null
if [ "$?" = 0 ]; then
cd...
16,007
Posted By jpprial
thanks everyone, for the easy way. if you would ...
thanks everyone, for the easy way. if you would like a more complicated method, try this:

ls|egrep [a-z]|cut -d : -f2 > list$$;cat list$$|xargs ls -l; rm list$$

JP;)
16,007
Posted By jpprial
find lowercase filenames
How do I write the command to find all files with any lower case letters in the filename? I have tried
find . -name *\(a-z\) and a lot of combinations like that, without success.

thanks...
7,624
Posted By jpprial
decision, case, it then else?
I'm writing this script in Korn Shell, on AIX. The script will print a log file, and it needs to decide what region it's in before printing.

( the output of db2 "get instance" is either
"The...
5,655
Posted By jpprial
I see that it works. But somehow I have to count...
I see that it works. But somehow I have to count the empty fields, to make sure that there are 4 fields, empty or not. I tried adding an "or" to the test statement (for fields 2 and 4, which can be...
5,655
Posted By jpprial
wow, thanks. that's getting there, but the -z...
wow, thanks. that's getting there, but the -z won't allow for empty fields, which i think are legal, like this line:

ups::respawn:rtprio 0 /usr/lbin/ups_mond -f /etc/ups_conf

doesn't a blank...
5,655
Posted By jpprial
I'll use sed and awk when I get more familiar...
I'll use sed and awk when I get more familiar with them, I think grep will work for what I need to do, here's my script so far, with some of the "various things" I want the loop to do included as...
5,655
Posted By jpprial
thanks rwb, exactly what i was looking for. but...
thanks rwb, exactly what i was looking for. but i'm stuck there now. i was planning to use grep to anaylze inittab, you know, grep lines that begin with a # and ignore them, check the fields...
but...
5,655
Posted By jpprial
file feed one line per argument
What tools can I use to accomplish this?
I'm writing a shell script to analyze an inittab file. Here's a sample file:

init:3:initdefault:
ioin::sysinit:/sbin/ioinitrc >/dev/console 2>&1...
12,029
Posted By jpprial
try this: user=`grep $1 /etc/passwd|cut -f...
try this:

user=`grep $1 /etc/passwd|cut -f 5 -d:`
echo $user
14,272
Posted By jpprial
this is my version: GNU bash, version...
this is my version:
GNU bash, version 2.03.8(1)-release (i386-redhat-linux-gnu)
Copyright 1998 Free Software Foundation, Inc.

The alias will only work in an interactive shell. I get an...
14,272
Posted By jpprial
thanks, it didn't work in bash, but I found a...
thanks, it didn't work in bash, but I found a way around:
using test, do, and done -
test [ "$sign" = "+" -o "$sign" = "-" ]; do...
not the most elegant, but it works.
14,272
Posted By jpprial
Korn vs Bash
Let's say I have
alias good_op=`[[ "$sign" = "+" || "$sign" = "-" ]]`
in a Korn shell script. How can I write that in a non-interactive bash shell?
3,249
Posted By jpprial
hit 'enter' with no user intervention
I'd like to write a shell script that will enter '1', for example. How
do you do that?
You know, so instead of writing

echo "Enter 1 or 2"
read onetwo

and waiting for the user to enter a 1...
4
9,411
Posted By jpprial
xargs works
Thanks everyone. I did get it to work, using xargs with the -n1
option.

file1 is just a list of numbers, one per line:
1234455
7778889



cat file1 | xargs -n1 "db2 select * from table1...
4
9,411
Posted By jpprial
xargs
Can I use xargs to send a list of commands to a process, to be acted upon individually? Here's what I have: a file that contains numbers, one per line. The desired outcome it to send each number to a...
8,403
Posted By jpprial
home directory in search path
Is it unsafe to put your own home directory (a regular user) in your search path? I am writing useful shell scripts, but don't have the permissions to put them in /usr/bin. (Korn shell)

thanks
2,688
Posted By jpprial
pass argument to a filename
How can I use the value of an argument as a filename? Example:
The argument for a process is 999. I would like the output of the process to be placed in a file called 999. I have tried using $$1,...
7,317
Posted By jpprial
adding "ifs"
Thanks, this works: ls -l $* | grep .java$ | sed "s/-/J/"

It produces this output:

Jrw-r--r-- 1 jprial cdgrp 15 Apr 02 12:29 new.java

That's one down, but I need to put this...
7,317
Posted By jpprial
+ tr
Well, I have the arguments passing, but I need some help with tr. I would like to change the first - in the ls -l output to T for text file, B for binary, S for script, and so on. That part is not...
7,317
Posted By jpprial
I'm trying to pass a filename, or all the files...
I'm trying to pass a filename, or all the files in the current directory to the ls command with a script. Unsuccessful so far, here are a few of my attempts:

#!/bin/ksh

read fname
#if (( $# >...
26,605
Posted By jpprial
Is there an option, for cat, head, tail, or is...
Is there an option, for cat, head, tail, or is there any way, to display a file from last line to first? For example, my file
looks like this:

aaaa
bbbb
cccc
eeee

and I would like to print...
6,801
Posted By jpprial
I have to query a DB2 database, and sometimes...
I have to query a DB2 database, and sometimes they take a long time to produce results. Can I run these queries in the background, and if so, where will the results appear?
4,417
Posted By jpprial
:h "is not an editor command" is what vi tells me...
:h "is not an editor command" is what vi tells me when I try that. Here is my .exrc, is there anything in there that's causing the switch?
set ai list sw=4 showmatch smd
Showing results 1 to 25 of 30

 

Featured Tech Videos

All times are GMT -4. The time now is 02:09 AM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy