Search Results

Search: Posts Made By: TonyLawrence
Forum: AIX 04-01-2010
36,015
Posted By TonyLawrence
You could pipe grep to "head -1" - might even...
You could pipe grep to "head -1" - might even improve the speed :-)
1,746
Posted By TonyLawrence
From your description, this sounds like...
From your description, this sounds like stair-stepping. That's just CR/LF translation - you are sending a Unix file with only NL (LF) to a printer that wants CR/NL.

Most printers can be set to...
935
Posted By TonyLawrence
#!/bin/bash read foo junk echo $foo echo ...
#!/bin/bash
read foo junk
echo $foo
echo $junk


$ ./t foo junk rest

foo junk rest
foo
junk rest

Or:

#!/bin/bash
read foo
set $foo
echo $1 $2 $3 etc.

./t foo junk rest more
1,457
Posted By TonyLawrence
Generally you'd use sed or awk to strip whatever...
Generally you'd use sed or awk to strip whatever you don't want. Something like

yourprog | sed 's/.* in//'

or

yourprog | sed 's/.* in/This is: /'
7,456
Posted By TonyLawrence
You mean you want me to write your script? I...
You mean you want me to write your script?

I gave three examples at that article. In comments people gave other examples. I think that's enough, but maybe not for you.

I'll tell you what: ...
7,456
Posted By TonyLawrence
You are mixing shell script commands into an FTP...
You are mixing shell script commands into an FTP session. That doesn't work.

If you want more power from FTP, consider using Perl. See my Perl Net::FTP...
1,381
Posted By TonyLawrence
True, but the question is why would you do such a...
True, but the question is why would you do such a thing?

The answer is usually portability. If your script needs to ">file", that alone won't work everywhere and neither will "echo -n > file"...
9,843
Posted By TonyLawrence
You HAVE it in an array: my @array_of_data =...
You HAVE it in an array:

my @array_of_data = <DATA>;


So don't

print MAIL <DATA>;

do

print MAIL @array_of_data ;
1,444
Posted By TonyLawrence
I could be wrong, but that sounds a lot more like...
I could be wrong, but that sounds a lot more like homework than a task delegated by a boss.
Forum: Programming 03-25-2010
3,298
Posted By TonyLawrence
If you have shared memory, why does the server...
If you have shared memory, why does the server need to handle the input?

The client process writes and reads shared memory. What else is needed?
Forum: Web Development 03-25-2010
2,534
Posted By TonyLawrence
I'll second the nomination for Wordpress. I...
I'll second the nomination for Wordpress. I don't use it on my site because I'm a total control freak and don't like Php, but it really is the easiest way to get started and has enough legs to take...
4,591
Posted By TonyLawrence
If they are always named "xy_" something, then ...
If they are always named "xy_" something, then

cp `ls -ut xy_* | head -1` b/

works. Or if it's always 2 character underscore and date, then

cp `ls -ut ??_* | head -1` b/
5,125
Posted By TonyLawrence
If you are able to run it and someone else...
If you are able to run it and someone else cannot, it's either perms (including perms on directories they'd need to traverse) or their PATH is not the same as yours.
43,233
Posted By TonyLawrence
Actually what you probably want is echo -e "First...
Actually what you probably want is echo -e "First Line \n Second Line"
1,298
Posted By TonyLawrence
The answer is always always the same: something...
The answer is always always the same: something not set in ENV.

If you think it really is cron, see Cron is not working (http://aplawrence.com/Unixart/crontab_not_running.html)

Otherwise, a...
Forum: AIX 03-24-2010
3,785
Posted By TonyLawrence
mt status ? Solaris - mt (1)...
mt status

?
Solaris - mt (1) (http://www.smccd.net/accounts/sinkewitsch/msink/usail/man/solaris/mt.1.html)
8,822
Posted By TonyLawrence
There is so much left out here. What Unix? You...
There is so much left out here. What Unix? You might be running a modern Linux, Solaris, some old SCO system or who knows what and the issues of sending mail are going to vary with those.

What...
Forum: Solaris 03-24-2010
21,652
Posted By TonyLawrence
I'd strongly recommend using GNU grep. If that's...
I'd strongly recommend using GNU grep. If that's simply not possible, see How can I recursively grep through sub-directories? (http://aplawrence.com/Unixart/recursivegrep.html)
1,061
Posted By TonyLawrence
$PPID contains the parent PID. ps -p $PPID ...
$PPID contains the parent PID.

ps -p $PPID -o "comm="


gives you the calling process name and path.
36,484
Posted By TonyLawrence
Or single user mode (init state 1) The...
Or single user mode (init state 1)

The problem isn't that it's mounted; it's that you don't want any other process writing to the fs while fsck is running.
3,799
Posted By TonyLawrence
As noted, the command could be made setuid...
As noted, the command could be made setuid (assuming its not a shell script). If your system has "sudo", specific users can execute specific or general commands as another user or as root. If...
1,016
Posted By TonyLawrence
Nowadays, I tend to use Perl. If it is very,...
Nowadays, I tend to use Perl. If it is very, very simple I might use a .netrc script but that gives no easy way to trap errors.

Kermit has good scripting for FTP too - I just tend toward Perl...
960
Posted By TonyLawrence
I might suggest that you approach this...
I might suggest that you approach this differently.

If the user is logged out, there will be no tty listed in ps - it will be a question mark.

Secondly - hanging processes like this are almost...
120,067
Posted By TonyLawrence
Something like this will do the csv part. You'll...
Something like this will do the csv part. You'll need a loop around your files and this code assumes one record per file - easy enough to change if that's not true

#!/usr/bin/perl
open(I, "t");...
Forum: Solaris 03-16-2010
7,426
Posted By TonyLawrence
Like i need to pass simple ls -ltrh >temp1 on a...
Like i need to pass simple ls -ltrh >temp1 on a application server in mount point eg - /onestmp
how do i pass and capture the command.

How you pass the command depends on your programming...
Showing results 1 to 25 of 192

 

Featured Tech Videos

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