Search Results

Search: Posts Made By: chrisjones
10,854
Posted By chrisjones
thanks for the reply, I tried that but user beta...
thanks for the reply, I tried that but user beta doesn't have permission to mv/cp from /tmp directory. User only has permissions for home dir. Any other ideas??
10,854
Posted By chrisjones
scp + sudo
There are two servers, server A and B. User alpha has read/write permission for server A but can only logon to server B . For read write permission on server B user alpha has to use

Sudo -u...
1,047
Posted By chrisjones
File B does contain regular exprs
File B does contain regular exprs
1,047
Posted By chrisjones
efficient way to find diff
I have two files A and B. I want to create file C which is A - B. I am currently using

grep -v -f B A > C

Is there a more efficient way. Files A and B are both large files

Thanks
1,402
Posted By chrisjones
Thanks I was just missing the "->"...
Thanks I was just missing the "->" symbol
1,402
Posted By chrisjones
#!/usr/bin/perl sub addToHash{ my ($href)...
#!/usr/bin/perl

sub addToHash{
my ($href) = @_;
$href{ 'A' } = 'value';
$href{ 'B' } = 'value';
$href{ 'C' } = 'value';
print("Hashmap size is " .keys(%href) . "\n");
}

my %myhash =...
1,402
Posted By chrisjones
Basic Perl - pass by ref
#!/usr/bin/perl

sub addToHash{
my(%hash) = @_;
$hash{ 'A' } = 'value';
$hash{ 'B' } = 'value';
$hash{ 'C' } = 'value';
print("Hashmap size is " .keys(%hash) . "\n");
}

my %myhash...
1,961
Posted By chrisjones
grepping log files
I have a log file and I have two unique strings which represent the start and end of the text I want to obtain.

How can I get all the text inbetween this start string and the end string?
...
2,179
Posted By chrisjones
Thanks, after a bit of googling, found a one...
Thanks, after a bit of googling, found a one liner that works

rename .sh .pl *.sh
2,179
Posted By chrisjones
Rename all .sh files to .pl
I have various .sh and .pl files in one directory. I want to rename all the .sh files to .pl

i.e testscript.sh --> testscript.pl


I am trying to use mv *.sh *.pl

It doesnt work though!!
2,421
Posted By chrisjones
Thanks stating full path works fine
Thanks stating full path works fine
3,417
Posted By chrisjones
OK thanks ill have a look into sftp
OK thanks ill have a look into sftp
2,421
Posted By chrisjones
Lets say I have two scripts A and B. ...
Lets say I have two scripts A and B.

Script A is using a function in B

So I use . scriptB to get access to all functions.

This works fine if I run scriptA in directory that scriptB is...
3,417
Posted By chrisjones
Secure copy help
I want to use scp in a script and have two questions:

1. Is there a way to use password in script, so script does not halt and ask for my password for remote box half way through?

2. The...
1,753
Posted By chrisjones
Thanks, works great
Thanks, works great
1,753
Posted By chrisjones
Alias help
I can get the nth line of a file using
sed -n 'np' file

however all I want to type is "line n file" so I am trying to use alias
alias line='sed -n \'&\''

but its not working, how can I make...
7,095
Posted By chrisjones
Using ls to list / not list certain files
In my fodler I have lots of .gz files and a few other files

I can use ls *.gz to list all those files

but how to I list files which do NOT end in .gz

thanks
1,432
Posted By chrisjones
Thanks, that worked great
Thanks, that worked great
1,432
Posted By chrisjones
Print Array function
The code below prints outs each array element, but it always says the array length is 1 even though its not. What am i doing wrong?


function printArray(){
#here should check if it is...
2,421
Posted By chrisjones
Great thanks very much
Great thanks very much
2,421
Posted By chrisjones
Call external function
Is it possible to call a function from another script?

Thanks
4
1,079
Posted By chrisjones
Thanks, I didnt try escaping in quotes
Thanks, I didnt try escaping in quotes
4
1,079
Posted By chrisjones
Grep
I am using this command

man grep | grep "- D"

as I want to see quickly what the D flag does in grep. however I keep getting the an error. I have tried exscaping -D so it doesnt think it is an...
Showing results 1 to 23 of 23

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