I agree with m.d.ludwig. What is the purpose of the script? Where do the values of these variables come from?
We can avoid using "ls" by using "test -f " instead. Can use unix "touch" command to ensure that the logfile is aways there.
Hello
#!bin/ksh
sqlplus -s system/manager < |grep '^ORA' |uniq
select * from kk;
set echo on
show spool on
end;
/
EOF
save test.sh
sh test.sh
results
ORA-00942: table or view does not exist (3 Replies)
Hi
I'm hoping I could get some help on the following. I'm writing a script which will in turn create an ftp script then excecute it. eg
echo "user $user $pass" > $script
echo "cd $remote_dir" >> $script
echo "bi" >> $script
echo "mput $file" >> $script
echo "bye" >> $script
ftp -n -i $ip... (1 Reply)
I have written a UNIX script that will automatically ftp a file to a server. The problem is when I missed enter information w/in the .txt file that contains the userid/password and what file to transfer, I had no way of capturing the failuer of the file transfer. I verified w/in the script that the... (1 Reply)
Hi,
Can anybody tell me how to error trap an empty line. If i am asked for a password and I hit enter without entering any text, how do i display an error?
Thanks
Kev (6 Replies)
I am writing a program which is something like below:
rsh host1 "rcp file dest:directory"
I am running this script from a machine host2.
host1 has rlogin configuration for host2.
but, dest machine has no rlogin configuration for host1 and fails on remote calls.
Could anyone tell me how... (2 Replies)
Greets all. I'm using Slackware 12.0 with the bash shell. Calling my scripts with /bin/sh...
I'm building gnome-2.18.3 and I have all my build scripts ready and working but I'm calling them from a parent script which executes each child/build script in a certain order (for loop).
I have "set... (6 Replies)
This is gonna sound dumb but...
1 It seems that I cannot use the search function here properly.
In researching to find a solution to an FTP error trapping issue, I go to the search option in the forum and use FTP as a search term and ask it to select all forums to search in..... I get no... (2 Replies)
How can I trap and print "cannot find the pattern" when the grep is unable to find the specified pattern in the file using the for loop below ?
Any help would be appreciated.
bash3.4> cat test_file
apple
orange
pineapple
blackberry
script:
for x in `grep -n "mango" test_file... (4 Replies)
I hope that I can trap curl errors, and have my shell script error out and quit if curl has any sort of problem.
For example, I have the following command in my shell script:
curl --trace -n -v --ftp-ssl ftp://xxx.xxx.xxx.xxx:2122 --user user:password -o /tmp/file.txt
Works great, except... (2 Replies)
I have a requirement:
During copy command for example:
cp -rf <sourceDir> <destinationDir>
this command may fails for many reasons like:
1. source or destination directory does not exist
2. destination directory does not have sufficient space
3. directories are not mounted
... Or may... (3 Replies)
Discussion started by: ambarginni
3 Replies
LEARN ABOUT MOJAVE
logsave
LOGSAVE(8) System Manager's Manual LOGSAVE(8)NAME
logsave - save the output of a command in a logfile
SYNOPSIS
logsave [ -asv ] logfile cmd_prog [ ... ]
DESCRIPTION
The logsave program will execute cmd_prog with the specified argument(s), and save a copy of its output to logfile. If the containing
directory for logfile does not exist, logsave will accumulate the output in memory until it can be written out. A copy of the output will
also be written to standard output.
If cmd_prog is a single hyphen ('-'), then instead of executing a program, logsave will take its input from standard input and save it in
logfile
logsave is useful for saving the output of initial boot scripts until the /var partition is mounted, so the output can be written to
/var/log.
OPTIONS -a This option will cause the output to be appended to logfile, instead of replacing its current contents.
-s This option will cause logsave to skip writing to the log file text which is bracketed with a control-A (ASCII 001 or Start of
Header) and control-B (ASCII 002 or Start of Text). This allows progress bar information to be visible to the user on the console,
while not being written to the log file.
-v This option will make logsave to be more verbose in its output to the user.
AUTHOR
Theodore Ts'o (tytso@mit.edu)
SEE ALSO fsck(8)E2fsprogs version 1.44.1 March 2018 LOGSAVE(8)