Search Results

Search: Posts Made By: yongho
4,767
Posted By yongho
if (( var1 && var2 )) ?? **fixed
*EDIT -- **FIXEd I must've done something wrong, because it works now..



I punched in "if" in the forum search but nothing came up, so I'm posting it here.

Quick question: Can someone...
8,711
Posted By yongho
#include?
I have a file that contains some variables that I may want to share throughout multiple scripts.

I think there's an #include command in UNIX.

How do I use it (in korn)?
18,386
Posted By yongho
ls -l | grep $date (failing)
Example file list
> ls -l
-rwxr-xr-x 1 ....... ...... 1707 Feb 5 2004 file1
-rwxr-xr-x 1 ....... ...... 175 Jan 21 2005 file2
-rwxr-xr-x 1 ....... ...... 95 Apr 1...
3,917
Posted By yongho
Solution
Here is my code now. It works (at least for now).

#!/bin/ksh

#=============
# date.ksh
#=============
# Last updated: July 29, 2005

#================================
# This script uses...
3,917
Posted By yongho
I'm almost done with my version. I'll post...
I'm almost done with my version.

I'll post it up soon so people can compare the easy way (Your way) and the hard way (My way)
3,917
Posted By yongho
:eek: Amazed.
:eek: Amazed.
3,917
Posted By yongho
Hrm..
I'm not familiar with the code you just wrote. :confused:
Can that be done with korn shell?
3,917
Posted By yongho
Date Intervals
I posted a question on date intervals about a month back asking about how I could be able to go about a user entering the starting year/month/day and an ending year/month/day and then the script...
29,474
Posted By yongho
Sorry gersh, I edited my post after you posted. ...
Sorry gersh, I edited my post after you posted.
Is there another alternative to set -A myArray value1 value2 value3 value4 ?
29,474
Posted By yongho
Assigning values to an array
The way I've been using arrays currently have been:

#!/bin/ksh

set -A myArray

myArray[0]=value1
myArray[1]=value2
myArray[2]=value3
myArray[3]=value4

Is there a way I can assign values...
8,961
Posted By yongho
Nested Loop to Echo Multiple Arrays
I have three arrays which hold three elements each.
I have a fourth array which contains the names of those three arrays.
I'm having difficulty creating a nested loop that can loop through each...
5,649
Posted By yongho
Not sure what this means. command echo...
Not sure what this means.

command
echo $((010 - 1))

output
Variable syntax
But I see what you meant about same in decimal as it is in octal.

command
expr 010 - 1

output
9
5,649
Posted By yongho
#!/bin/ksh set -A myArray ...
#!/bin/ksh

set -A myArray

myArray[1]='one'
myArray[01]='zero_one'

echo ${myArray[1]}
echo ${myArray[01]}

output
zero_one
zero_one
5,649
Posted By yongho
nah
wait let me post you some code ..
5,649
Posted By yongho
damn
Ah damn, then I'm definitely running an older version of ksh/bash.
Because myArr[01] was the same as myArr[1].
5,649
Posted By yongho
oh..
I see. That's very useful hmm.

Is the value of myArr[1] the same value as myArr[01]?
or myArr[0] same as myArr[00] ?
5,649
Posted By yongho
are Associative Arrays possible in UNIX?
Is it possible to say..

myArr['filename']=34
myArr['next_filename']=15

?
4,492
Posted By yongho
here-doc convert 2 script convert to single script?
I have my main script calling another script to retrive a "ls -alt" of a directory that's located in a remote location I'm sftping into.

main.sh
#!/bin/ksh
getLS.sh > output.txt
getLS.sh...
4,181
Posted By yongho
:eek: Oh my goodness. I feel so dumb I'm...
:eek: Oh my goodness.

I feel so dumb I'm laughing at myself right now.
That worked so well.......

Thanks.
4,181
Posted By yongho
AWK line by line instead of field by field?
I've been using a lot of awk lately for csv files.
But I've been using awk for csv files that contain 32 fields per line.

For the first time, I've been given a csv file that contains one field...
4,944
Posted By yongho
quick check of my awk syntax
I've made an awk command that works successfully.
However I'd like to add one character to it.

For example instead of /what_i_have_now/
I'd like to change just ONE field to the opposite with an...
15,645
Posted By yongho
thanks
thanks..!

I spent way too much time using AWK and haven't touched SED enough yet.
15,645
Posted By yongho
typset -Z2
The Typeset -Z2 command you told me about works really great for the if statement I posted before, since now I don't even need the if statement. But later on in the script, I need to take the value...
15,645
Posted By yongho
hm
That's actually in Korn Shell. I found it here on google.

http://www.awprofessional.com/articles/article.asp?p=99035&seqNum=3

It's one of the last examples way at the bottom.
15,645
Posted By yongho
how to check first character in var's value.
Currently my script works like this:

DATE_dd=5 # Assume this is user input. (User can enter 1, 2, 3, .. 10, 11, 12)

if [ ${#DATE_dd} == 1 ]; then
DATE_D=" ${DATE_dd}"
...
Showing results 1 to 25 of 92

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