11-04-2014
Quote:
Originally Posted by
gkelly1117
cd $READDIR
find $READDIR -type f -name '*.ready' | while read file
do
real_file="${file%.ready}"
echo "put $real_file $FTPDIR" >> tde_batch
cp $real_file $TDE_BACKUP
done
echo "quit" >> tde_batch
sftp -b tde_batch "$FTPUSR@$FTPHOST"
cp tde_batch $TDE_BACKUP/tde_batch.$CURRDATE
rm tde_batch
rm *
exit 0[/CODE]
I would like to bring to your attention the following combination of commands in red, which has the potential of spread disaster.
The command
cd will silently change directory to your
$HOME if it can not use
$READDIR to change. Once's in there I don't know the mayhem that it would do, but for sure you can kiss goodbye to your data in $HOME.
Some ways to minimize the risk is to use absolute paths and if you cd check $PWD or pwd, and compare with where you should be.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello ,
I am trying to make a shell script (Unix) for a ftp connection to another server and to get a file.
So I have no knowledge about ftp and my script must do automaticly the connection with the user and passwd.
Can you help us about that...
Christian... (2 Replies)
Discussion started by: steiner
2 Replies
2. UNIX for Dummies Questions & Answers
Novice here...
I need help with excuting a shell script on a flat file that I've transfered over from a Windows XP machine for manipulation through an auto FTP script...
so that after it is transfers it excutes the shell script and then returns it back to XP machine...
Any ideas... (2 Replies)
Discussion started by: Gerry405
2 Replies
3. Shell Programming and Scripting
I have my ftp script as below..
This is logging the messages into ftp.log file ,
But I want the same output(what ever messages are going into ftp.log) to be printed on the console too for the user to show the status.. Tried with "tee" .. unable to get the solution..
Can some one help me... (3 Replies)
Discussion started by: Srini75
3 Replies
4. Shell Programming and Scripting
Hello,
A couple of times per week, i receive emails notifications when files are available for processing.
Currently i read these eamails with a java program and store the attachement on my C: drive and would now like to generate a PC script to send this file name up to UNIX-Solaris and... (3 Replies)
Discussion started by: bobk544
3 Replies
5. Shell Programming and Scripting
I have the following ftp script to get files from a remote location.
However, on running the script I find that I am not even able to connect to ftp server.
I am able to connect to ftp server using other GUI ftp tools like WS_FTP using the same IP.
IP used here is a dummy IP.
What can go... (3 Replies)
Discussion started by: gram77
3 Replies
6. Shell Programming and Scripting
Hi,
I have a ftp script which first gets all the file names and echo's the latest file.
I'm using another ftp command sets to get the file name given by first ftp. The problem is the parameter is not accepted by second ftp. The error message i'm getting is
> Rename Temp File calloc:ICMP... (5 Replies)
Discussion started by: ammu
5 Replies
7. Shell Programming and Scripting
Hi all,
I'm using the following script to automated ftp files to 1 ftp servers
host=192.168.0.1
/usr/bin/ftp -vi >> $bkplog 2>&1 <<ftp
open $host
bin
cd ${directory}
put $files
quit
ftp
and the .netrc file contain
machine 192.168.0.1
login abc... (4 Replies)
Discussion started by: varu0612
4 Replies
8. Linux
Hi,
Currently i'm using the folllowing FTP acript and its working.
echo "open $server" > ftp_file
echo "user $user $password" >> ftp_file
echo "cd $remote_dir" >> ftp_file
echo "lcd $local_dir" >> ftp_file
echo "put $file">> ftp_file
echo "bye" >> ftp_file
ftp -nv < ftp_file
I've... (1 Reply)
Discussion started by: vickramshetty
1 Replies
9. Shell Programming and Scripting
hello ,
I am working on a FTP script which navigates to specific directory and pulls the file
Issue which i am facing ::
----------------------------
i) When there is a file it pulls the file , but when there is not file in the directory it fails in the same statement and it is not... (3 Replies)
Discussion started by: ranga27
3 Replies
10. Shell Programming and Scripting
Hi,
I am new to shell scripting,and i was planning to write a script that will FTP files to destination folder.
I was planning that All configuration should be done through a properties files. and finally the output should be
Files are transferred
I have developed a properties file named... (4 Replies)
Discussion started by: rahul125
4 Replies
LEARN ABOUT MOJAVE
set_color
set_color(1) fish set_color(1)
NAME
set_color - set_color - set the terminal color
set_color - set the terminal color
Synopsis
set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR]
Description
Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple,
cyan, white and normal.
o -b, --background Set the background color
o -c, --print-colors Prints a list of all valid color names
o -h, --help Display help message and exit
o -o, --bold Set bold or extra bright mode
o -u, --underline Set underlined mode
o -v, --version Display version and exit
Calling set_color normal will set the terminal color to whatever is the default color of the terminal.
Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey
font color, while set_color --bold white will result in a white font color.
Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator.
set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and
incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of
ncurses and recompile fish against it in order to fix this issue.
Version 1.23.1 Sun Jan 8 2012 set_color(1)