Search Results

Search: Posts Made By: butterfm
53,524
Posted By butterfm
Not sure if fuser will work on all flavours of...
Not sure if fuser will work on all flavours of UNIX.

This will loop until the file is copied. It will check every 60 seconds to see if the file is still locked and copy it when it's unlocked.

I...
68,363
Posted By butterfm
Hi Gina, Try something along these lines ...
Hi Gina,

Try something along these lines

sed 's!\\r\\r\\n!\\r\\n!g' file.txt
Hope this helps.

Matt.
5,132
Posted By butterfm
The easiest soltion would be to copy the lot then...
The easiest soltion would be to copy the lot then remove folders 2 & 3.
17,538
Posted By butterfm
It's difficult to say what the cause is from...
It's difficult to say what the cause is from looking at the script. Maybe a new line character is appended to the end of one of the variables.

you could try this with each of the variables before...
95,133
Posted By butterfm
There are loads of ways to do it. Another...
There are loads of ways to do it.

Another is

echo "1 + 2" | bc

Matt
8,442
Posted By butterfm
Hi, I'm sure somebody will correct me if I...
Hi,

I'm sure somebody will correct me if I am wrong here but I don't think awk loops through the fields on each record and therefore there isn't a current field as such.
The main input loop is...
3,000
Posted By butterfm
Hi, I might be missing the point of the...
Hi,

I might be missing the point of the question but can't you just do

get test.$DATESTAMP.dmp

instead of

mget test*.*

Matt.
3,562
Posted By butterfm
This method works for me while read line ...
This method works for me

while read line
do
echo "$line"
done < filename

Note the double quotes round the variable

Strangely enough the quotes don't work using a for loop. Not...
3,165
Posted By butterfm
You could use gzip to compress on linux and the...
You could use gzip to compress on linux and the same tool to decompress on UNIX.
2,712
Posted By butterfm
Just redirect the output to a log file using > ...
Just redirect the output to a log file using >

e.g.

find . -exec grep string {} \; > ./mylog

Matt.
23,112
Posted By butterfm
Hi nhatch, The syntax errors are caused by...
Hi nhatch,

The syntax errors are caused by the -ne being used with a value in quotes.

-ne shoudl be used with numbers.
If you are comping strings use !=

e.g.

if [ $1 != "07[0-9]\{9,9\}"...
3,192
Posted By butterfm
It could be either - which is not very helpful. ...
It could be either - which is not very helpful.

The easiest way to check would be to try another monitor. If it continues it's the video card. If not it's the monitor.

Also does it only happen...
15,448
Posted By butterfm
You can set up an ftp site on the NT box using...
You can set up an ftp site on the NT box using IIS.
23,112
Posted By butterfm
I may be wrong but I don't think if [ $1 =...
I may be wrong but I don't think

if [ $1 = 44* ]; then

Will work with wildcards

You may need to use the ksh version

[[ $1 = 44* ]] && ....

Matt.
9,846
Posted By butterfm
You will need to pass $X into awk using the -v...
You will need to pass $X into awk using the -v flag as follows

awk -F: -vgrp=$X '$1 ~ grp {print $3}' /etc/group

the awk varaible grp holds the value of $X

Matt.
9,846
Posted By butterfm
Good point. awk -F: '$1 ~ /dev/ {print $3}'...
Good point.

awk -F: '$1 ~ /dev/ {print $3}' /etc/group

Will only print the 3rd column on lines where the 1st column is "dev"

Matt.
9,846
Posted By butterfm
Hi Sleepster, This shows how to do it for a...
Hi Sleepster,

This shows how to do it for a group called dev.

grep dev /etc/group | awk -F: '{print $3}'

Matt.
7,651
Posted By butterfm
They are only valid within awk. You can capture...
They are only valid within awk. You can capture awk's output to a variable or file if you want.

e.g.

user=`awk -F, '{print tolower(substr($1,0,1)) tolower(substr($1,match($1," ")+1,7))}' file1`...
7,651
Posted By butterfm
This will give you what you want as far as the...
This will give you what you want as far as the username is concerned :

awk -F, '{print tolower(substr($1,0,1)) tolower(substr($1,match($1," ")+1,7))}' file1

Where file1 contains

John...
7,651
Posted By butterfm
My last post was slightly innacurate. If you just...
My last post was slightly innacurate. If you just want to lowercase the first letter do :

echo "Word" | cut -c1 | tr [A-Z] [a-z]

Which would return "w"

Matt.
7,651
Posted By butterfm
Hi Sleepster, Awk would be your best bet for...
Hi Sleepster,

Awk would be your best bet for manipulating fields in a comma seperated file.
If you post your file and what you want as the output we will be able to help.

To retreive the...
31,882
Posted By butterfm
yoyomamma, I don't think that what you're...
yoyomamma,

I don't think that what you're asking can be done in ftp.

Matt.
72,859
Posted By butterfm
Hi pnxi, Again using AWK, this will ignore...
Hi pnxi,

Again using AWK, this will ignore jpg and gif files. You will need to add jpeg and png files.

awk '! ($2 ~ /jpg/ || $2 ~ /gif/) {print $0}' tmp

It's worth taking the time to learn...
4,040
Posted By butterfm
Not sure I understand the question. If you want...
Not sure I understand the question. If you want to transfer a file from your machine to another machine that you have an account on then ftp is the way to go.

ftp remote_machinename
cd remote...
72,859
Posted By butterfm
Awk is also a natural choice to do this sort of...
Awk is also a natural choice to do this sort of job.

awk 'BEGIN{total=0}
{total += $1}
END{print total}' tmp

Use something like the above but before implementing it into your script get a...
Showing results 1 to 25 of 25

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