Search Results

Search: Posts Made By: parpaa
2,798
Posted By CarloM
Just add them to the heredoc for your SFTP...
Just add them to the heredoc for your SFTP session:
sftp host@abc.com <<EOF
lpwd
lls
cd Test
put ${file1_To_Copy}
EOF
3,415
Posted By Scott
Try: typeset -i var1=$(wc -l < sales.txt) ...
Try:

typeset -i var1=$(wc -l < sales.txt)


You can run the wc command on its own both ways (with and without <), to see the difference, and why it's giving the error.
3,415
Posted By bakunin
It might help to properly indent your code. For...
It might help to properly indent your code. For the machine it doesn't matter but it makes for easier reading.

#!/bin/bash

var=1
var1=`awk '{n++} END {print n}' sales.txt`

while [[ ${var}...
109,186
Posted By Ygor
You should look at the manual pages for sendmail....
You should look at the manual pages for sendmail. I have only included the bare minimum to get you started. You can add headers like "To:", "Cc:", "Bcc:", "Apparently-To:", etc. This can be done...
7,148
Posted By bakunin
Good point. It might help to change the line to: ...
Good point. It might help to change the line to:

sftp sftpabc@abc.com <<-EOF



Yes, but....

It might be even better/easier to put a pair of set -xv (switch on debugging) and set +xv...
7,148
Posted By Corona688
It may be sftp that's giving 'permission denied',...
It may be sftp that's giving 'permission denied', when you try to upload a file, or even when you try to change directory. What are the permissions on the remote host?
8,240
Posted By Scott
Simply, using: # DAY=12 # date +%Y-%m-$DAY...
Simply, using:

# DAY=12
# date +%Y-%m-$DAY
2013-09-12


There's no validation, though:

# DAY=31
# date +%Y-%m-$DAY
2013-09-31
3,984
Posted By RudiC
Don't use parentheses; use [[ . . . ]] instead. ...
Don't use parentheses; use [[ . . . ]] instead.
And, be aware that this will be a string compare, so 10/08/2013 is gt 09/08/2014...
2,650
Posted By MadeInGermany
With GNU ls (in Linux) you can specify the time...
With GNU ls (in Linux) you can specify the time format:
ls --time-style=+%m/%d/%Y -ld log1.csv | awk '{print $6}'
1,109
Posted By Corona688
The correct way to do this with ssh/scp/sftp (all...
The correct way to do this with ssh/scp/sftp (all the same protocol) is to use keys (http://www.debian-administration.org/articles/152). By generating the right cryptographic files, and copying part...
1,002
Posted By Don Cragun
The first thing the command above will do is...
The first thing the command above will do is delete all of the contents of the file Report.txt. Then, if the -3 option is accepted by tail, it will copy that empty file to whatever directory is...
Showing results 1 to 11 of 11

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