Search Results

Search: Posts Made By: kornshellmaven
49,429
Posted By kornshellmaven
Command line buffer limit?
Is there a limit (255 chars?) on the command line??

I'm trying to copy some generated java & class files from one dir to another and ID the old & new versions by:

find . -name...
5,815
Posted By kornshellmaven
How about: grep -q lili file && grep -q yoyo...
How about:

grep -q lili file && grep -q yoyo file && print "found both"
4,325
Posted By kornshellmaven
Thanks all. Using a backslash \ls or quoting...
Thanks all.

Using a backslash \ls or quoting "ls", 'ls' works to access the "real" command as opposed to the alias.

This method does not seem to work for functions.

I'm running an older...
4,325
Posted By kornshellmaven
Sorry - unalias, unset -f are not what I'm...
Sorry - unalias, unset -f are not what I'm looking for -
Am looking to invoke the original command and not invoke the alias or function as a "one shot"
4,325
Posted By kornshellmaven
Alias's & Functions - simple question
Having a memory lapse:

If I redefine a command using an alias or a function - How do I access the "real" command without specifying an absoulte path:

i.e.

function man
{
/usr/bin/man |more...
33,847
Posted By kornshellmaven
My SA says he could install Expect/TCL on our...
My SA says he could install Expect/TCL on our development box, but would not be able to justify the install on our UAT & PROD servers. Providing a "convenience" to folks to synchronize passwords...
33,847
Posted By kornshellmaven
Hugo, Thanks for your reply. We're...
Hugo,

Thanks for your reply.

We're running under Sun Solaris 2.6 & 2.7

The man pages for rdist - shows info for remote file distribution.
There are no man pages for rsync or supper.

How...
33,847
Posted By kornshellmaven
Script to change UNIX password
My shop has just ordained that all UNIX passwords expire after 45 days. We do NOT have a "single logon" facility, so I will need to logon to each of the servers (15+) I interact with and change my...
4,659
Posted By kornshellmaven
add the destination email address to a file...
add the destination email address to a file ".forward" in your home directory.

Not sure off the top of my head how to selectively forward mail (i.e addressed to you as opposed to cc to you -...
2
2,225
Posted By kornshellmaven
For jobs running in background (invoked with &) -...
For jobs running in background (invoked with &) -
type jobs at prompt to see all jobs.

You can kill these jobs with "kill -9 %#" where %# is %1 or %2 or whatever the number of the job. (note: %...
4,309
Posted By kornshellmaven
ftp -n -v hostname <<-ENDTAG userid password ...
ftp -n -v hostname <<-ENDTAG
userid
password
the rest of your ftp commands
ENDTAG
2,278
Posted By kornshellmaven
also -s if the file size is non zero
also
-s if the file size is non zero
53,545
Posted By kornshellmaven
As far as where to put the script.... Anywhere...
As far as where to put the script....
Anywhere you like as long as the directory where the script resides is on the path

echo $PATH
to view the search path for executables.

To add your...
5,591
Posted By kornshellmaven
Update text files in place (string substitution) ??
The auditors have nailed us for world writeable files....

Apparently in years gone by, quite a number of our kornshell scripts have had:
umask 000 put in the script.

We have been able to turn...
20,479
Posted By kornshellmaven
This is a typical "batch" ftp script we run all...
This is a typical "batch" ftp script we run all the time:

#!/usr/bin/ksh

## put server name or IP address of FTP server
## provide username & password for the ftp server
## cd to whatever...
9,781
Posted By kornshellmaven
Hey PxT, The /dev/null is a nice twist - I'm...
Hey PxT,

The /dev/null is a nice twist - I'm not sure I understand why/how this works - I would have used a -l option on the grep to list the files. But showing the file & pattern found is nice.
...
6,087
Posted By kornshellmaven
In response to the first question posted: I use...
In response to the first question posted:
I use "type" or "whence" to determine where the script/pgm/command/etc is executing from (On some systems type is an alias for whence -v)

whence...
9,301
Posted By kornshellmaven
Not sure why it's not expanding the variables...
Not sure why it's not expanding the variables within the here-document - Turn xtrace on to see commands echoed back

The following works fine
#!/usr/bin/ksh -x
DATA=$AL_DATA
ftp -n -v slapdev...
2,369
Posted By kornshellmaven
How about using sed? cat file|sed 's/old...
How about using sed?

cat file|sed 's/old pattern/new pattern/g' >new_file

You can use sed to do a lot of editing "automatically"
strip off leading blanks on a line: 's/^ *//g'
strip off...
9,301
Posted By kornshellmaven
We use variations on the following script all...
We use variations on the following script all over the place. We designed an "FTP server" written in korn shell to handle ALL FTP's between different platforms aw well as our corporate "Enterprise...
26,367
Posted By kornshellmaven
I use find . -type f -mtime 0 I seem to...
I use
find . -type f -mtime 0

I seem to recall some issues with this - I needed to ID files which arrived via ftp & were processed today. Needed to copy them from the production archive...
26,367
Posted By kornshellmaven
BEFORE I issue an "rm" command inside a find...
BEFORE I issue an "rm" command inside a find -exec, I always test it extensively to be sure it's working properly.

There are a few variations:

find /path/to/dir -mtime +7 -type f -exec ls -l {}...
2
2,088
Posted By kornshellmaven
or set -o vi
or
set -o vi
26,367
Posted By kornshellmaven
I use a slight variation on find /path/to/dir...
I use a slight variation on
find /path/to/dir -ctime +7 -exec rm -f {} \;


find /path/to/dir -mtime +7 -type f -exec rm -f {} \;

I recommend the "-type f" because this restricts to regular...
Showing results 1 to 24 of 24

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