Search Results

Search: Posts Made By: stanleypane
20,175
Posted By stanleypane
A better question would be: Why would you...
A better question would be:

Why would you routinely use PDF formatted files as input into a script?

If you're spending time trying to automate some process, than you should look at replacing...
11,750
Posted By stanleypane
Sorry, don't know what I was thinking. Bash...
Sorry, don't know what I was thinking. Bash doesn't even notate arrays starting with an '@'.

Anyhow, the easiest way in perl is to use hashes (associative arrays):

#!/usr/bin/perl

@i =...
11,750
Posted By stanleypane
Not sure what shell and OS you're using, but I'll...
Not sure what shell and OS you're using, but I'll assume bash considering your array notation.

The following works in bash on Linux and AIX:

$ array_1[0]=0
$ array_1[1]=1
$ array_1[2]=2
$...
Forum: AIX 02-13-2009
4
11,837
Posted By stanleypane
The bos.cifs* filesets are what you're looking...
The bos.cifs* filesets are what you're looking for.

bos = Base Operating System.

These filesset don't install any additional commands. They just enable cifs support within the already...
Forum: AIX 02-12-2009
4
11,837
Posted By stanleypane
Yes, cifs will allow you to mount Windows shares....
Yes, cifs will allow you to mount Windows shares. I've successfully installed and used it on an AIX 5.2 server.

Those files are located on the original AIX installation CD's. You can mount each CD...
25,381
Posted By stanleypane
Well, if you have access to sudo as root, you can...
Well, if you have access to sudo as root, you can modify the sudoers file:
sudo visudo

Or, like I said, you can just modify the root crontab:
sudo crontab -e

If you don't have access to the...
2,567
Posted By stanleypane
openssh will provide you with the necessary...
openssh will provide you with the necessary programs. If you're looking to automate using ssh, you might want to use the scp command instead.

That, and you'll need to setup auth keys if you want...
25,381
Posted By stanleypane
It's probably got something to do with the way...
It's probably got something to do with the way you have sudo setup to handle passwords. There are a variety of options:

1. sudo will always ask for a password.
2. sudo will only ask the first...
Forum: Linux 02-11-2009
22,409
Posted By stanleypane
Just to clarify, you are experiencing this...
Just to clarify, you are experiencing this problem in Redhat when connecting via SSH through putty, correct?

Try using the ISO-8859-1 character set in Putty and set your LANG to en_US:
export...
15,553
Posted By stanleypane
Sorry, I've made some slight changes to your...
Sorry, I've made some slight changes to your script:

set LASInputFile = `ls *.[Ll][Aa][Ss] | head -1`
echo $LASInputFile
set j=1
while ($j <= 100)
set line="`cat $LASInputFile | head -$j |...
1,760
Posted By stanleypane
This script is written to use SFTP, but your test...
This script is written to use SFTP, but your test at the bottom shows that they don't have SFTP setup or it's on a different port than 22.

I'm betting they want standard FTP. Try using the ftp...
Forum: Linux 02-11-2009
22,409
Posted By stanleypane
I'd first check to make sure you're LANG...
I'd first check to make sure you're LANG environment variable matches the character set you've configured in Putty.

When logged into RH, do this:

echo $LANG

It should be set to en_US.UTF-8....
15,553
Posted By stanleypane
set LASInputFile = `ls *.[Ll][Aa][Ss] | head -1` ...
set LASInputFile = `ls *.[Ll][Aa][Ss] | head -1`

set i=`cat $LASInputFile | wc -l`
set j=1

while ($j <= $i)

set line=`cat $LASInputFile | head -$j | tail -1`

@ j = $j + 1

# do...
8,272
Posted By stanleypane
This will work on all unix flavors: tr -d...
This will work on all unix flavors:

tr -d '\r' < problem_file.txt > fixed_file.txt

You can write a quick script in ksh on your aix box that is a little easier:

#!/bin/ksh
#
# dos2unix.sh -...
27,043
Posted By stanleypane
A users default shell can be changed using the...
A users default shell can be changed using the chsh command. It should only accept shells listed in /etc/shells. Remove any shells from /etc/shells that you don't want users accessing.

Not all...
2,046
Posted By stanleypane
cnt and rest are both variables that receive...
cnt and rest are both variables that receive input from your textfile. The default for read is to delimit fields based on whitespace.

It works like this:

$ ls temp.txt
temp.txt
$ cat temp.txt...
201,123
Posted By stanleypane
^M is a carriage return. You should...
^M is a carriage return.

You should understand a few things first:

CR = \r = Carriage Return
LF = \n = Line Feed

In DOS, all lines end with a CR/LF combination or \r\n.
In UNIX, all lines...
42,774
Posted By stanleypane
You shouldn't have to use export to make...
You shouldn't have to use export to make variables within a function become global. Once a function is run, it's variables should be available throughout the rest of your script.

If you are...
3,804
Posted By stanleypane
You could try storing the results in an array and...
You could try storing the results in an array and then iterate through the results later. You'll lose any whitespace formatting, but it may help you get at what you need.

Here's a quick script I...
4,265
Posted By stanleypane
sed "s/STRING_ZERO/$(eval echo \$VALUE$i)/g"...
sed "s/STRING_ZERO/$(eval echo \$VALUE$i)/g" FILE_ZERO.txt >> FILE_NEW.txt
10,192
Posted By stanleypane
Not sure what cadenv and ccm are, but have your...
Not sure what cadenv and ccm are, but have your tried executing your commands using full paths?

sh -c "/path/to/ccm ..."

Perhaps the new environment is losing your $PATH variable?
20,535
Posted By stanleypane
If "testcase" always precedes the data you want,...
If "testcase" always precedes the data you want, you can use awk and specify a delimeter like so:

awk -F'testcase ' '{print $2}'
6,833
Posted By stanleypane
Try this ugly hack. I did this in bash, YMMV: ...
Try this ugly hack. I did this in bash, YMMV:

cat file.txt | while read line
do
echo $line | \
awk '{print $1" "$2}' | \
tr " " "\n" | \
sort -d | \
tr "\n" " "
echo -ne "`echo...
Showing results 1 to 23 of 23

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