Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: gacanepa
982
Posted By gacanepa
Print matching fields (if they exist) from two text files
Hi everyone,
Given two files (test1 and test2) with the following contents:
test1:
80263760,I71
80267369,M44
80274628,L77
80276793,I32
80277390,K05
80277391,I06
80279206,I43
80279859,K37...
2,176
Posted By gacanepa
I received an answer at another forum. Here's the...
I received an answer at another forum. Here's the link (http://www.linuxquestions.org/questions/linux-newbie-8/can%27t-disable-sslv3-in-apache-mod_nss-4175553342/) in case someone has the same...
1,233
Posted By gacanepa
[SOLVED] Sum numeric columns contained in a plain text file
Thank you very much!
I was almost there and couldn't understand why the text of the query was still being saved in the text file, until I read that the SET options are only good if you use it in a...
919
Posted By gacanepa
Please modify the title of this thread by adding...
Please modify the title of this thread by adding [SOLVED] before the current title, so that this thread will serve as a reference for other users in the future. BTW, glad it worked!
2,100
Posted By gacanepa
I insist that checking the existence of a file is...
I insist that checking the existence of a file is not the best way to allow or deny its execution.
What I would do is wget the file, then if that command completed successfully I'd start the...
10,961
Posted By gacanepa
Just adding my 2 cents here. Since we're still...
Just adding my 2 cents here.
Since we're still 10 days from the end of the month, you could temporarily change the date and time of your system to perform your test in advance:
date --set="1 OCT...
1,621
Posted By gacanepa
Just adding my two cents here. I've been there...
Just adding my two cents here. I've been there myself, and solved it by closing the ssh connection after connecting to each server and doing what I had to do, so during the next run of the while loop...
5,800
Posted By gacanepa
If you do this: ...
If you do this:
SRC=/hd1/home/$USER/.phonesync/photos-backupThen
DST=/hd1/home/$USER/.phonesync/photos-newAnd if your for loop is initialized like this:
for f in $SRC/*The copy command cp $SRC/$f...
5,800
Posted By gacanepa
This will do the trick: #!/bin/bash set -x ...
This will do the trick:
#!/bin/bash
set -x

# The source directory where the photo folder on the phone is mirrored to
SRC=test1

# The destination directory where we want to copy only new...
5,800
Posted By gacanepa
There you go. Refer to this line: + grep -q...
There you go.
Refer to this line:
+ grep -q /hd1/home/nick/test1.md5
The fact that the script stops there (and the fact that the command is incomplete) tells us that the error is in the previous...
5,800
Posted By gacanepa
First off, I'm a little confused why you're...
First off, I'm a little confused why you're getting an error after running copy.sh but the error points to another file (copy2.sh). Do you have 2 script files?
The error message you are getting...
1,600
Posted By gacanepa
Great! Just to clarify, from the link that I sent...
Great! Just to clarify, from the link that I sent you can download the latest version of The Linux Command Line, which was released less than a month ago.
9,674
Posted By gacanepa
Try this: gacanepa@debian:~$ cat file.xml ...
Try this:
gacanepa@debian:~$ cat file.xml
hola
chau
me
voy
gacanepa@debian:~$ awk '{$1=$1}1' file.xml
hola
chau
me
voy
gacanepa@debian:~$
You may want to redirect the output of the...
Forum: AIX 08-22-2013
2,707
Posted By gacanepa
You have already been given plenty of good advice...
You have already been given plenty of good advice in this thread, but I thought I may be able to contribute a little more. I consider The Linux Command Line to be the best book to learn Linux from...
5,209
Posted By gacanepa
Unix, you mean plain Unix? Good. And as to the...
Unix, you mean plain Unix? Good.
And as to the shell, if you're using Unix you should have bash available.
I'll get back to you later with something.
30,487
Posted By gacanepa
What do you mean by "environment"? Maybe the...
What do you mean by "environment"?
Maybe the following code snippet can help. In this example, I'm passing a certain file or directory as argument. You can later change that to better suit your...
3,221
Posted By gacanepa
Ok. Assuming that ssh is listening on port 22 in...
Ok. Assuming that ssh is listening on port 22 in each of those hosts, and that the file hosts.txt contains a list of IP addresses or hostnames this is what I'd do:
#!/usr/bin/ksh
while read line...
2,761
Posted By gacanepa
Just adding my 2 cents here. Another way to get...
Just adding my 2 cents here. Another way to get this done would be:
#!/bin/bash
# Do not show the titles of columns:
df -H | grep -vE '^Filesystem' | awk '{ print $5 " " $1 }' | while read...
1,130
Posted By gacanepa
Here you go
#!/bin/bash
echo "You provided the following argument: $1"
if [[ $1 =~ ^[0-9]{1,3}-[0-9]{1,3}-[0-9]{1,3}$ ]]
then
echo "yes"
else
echo "no"
fi

This script uses regular expressions:...
5,013
Posted By gacanepa
I assume you're concerned over this so that...
I assume you're concerned over this so that people can't mess up your system. Actually I don't believe it's possible to do what you want for 2 reasons:
1) rm -rf *: this command deletes all files /...
1,650
Posted By gacanepa
I am not sure about ksh, but as far as bash is...
I am not sure about ksh, but as far as bash is concerned, the single quotes DO NOT allow shell interpretation. That is to say, whatever is inside single quotes will be inserted into your database as...
11,864
Posted By gacanepa
Just adding my 2 cents here. Try this first...
Just adding my 2 cents here.
Try this first (don't add the other commands!):
ssh username@server
Does it even connect to the server? Do you get a confirmation? Are you sure that the remote server...
Showing results 1 to 22 of 22

 

Featured Tech Videos

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