I know that this is a ridiculously simple statement, but I am getting an error when I execute it, and I can't figure out what it is. Can anyone point me in the right direction?
#!/bin/ksh
integer dateMonth=0
integer intZero=0
if
then
dateMonth = 1
fi
echo $dateMonth (7 Replies)
I'm having an issue running multiple commands in a case statement. If i only run one command it works fine. Am I supposed to use double semi-colons after each statement or do i not need any at all?
here is a snippet of the code:
case `uname` in
"Linux")
echo This is linux.
cat... (1 Reply)
Hello,
I am trying to create a simple script that will check the disk usage of a drive, and if it is over the limit it will delete the oldest ten files. everything is working except for when i implement the if statement i get the error
/usb0: zero divisor.
I am pretty sure that the du -k... (1 Reply)
Hi there,
Im new in the scripting world and ran into trouble yesterday. I want to make a small script that runs in crontab checking folders. If the folder size is greater than 10 (or what I set the variable to) then send a mail with a warning.
#!/bin/sh
set -x
A=8
C=`du -skh... (7 Replies)
guys,
in one of my script, I want to include and a if and then statement which basically does the the following:
if a file (constant location and filename) is greater in size than 0 bytes, then it should send out an email.
I have tried the following so far with no luck:
1) if # is... (1 Reply)
Hi guys,
I'm typing the following command, but I'm getting a different output than expected.
for file in *20*
do
ls -l $file | wc -l
done
Instead of listing a total count of the files, it seems to be counting each file and then printing the number of the file - which is 1. How... (7 Replies)
Hello,
I have never actually created a bash script but thought I would give it a try and got hung up fast.(stupid noob). In the script I have parsed a xml file to get a bunch of file prefixs out. I am then going to check a folder to determine if a file with the correct prefix exists.
All the... (5 Replies)
if ]; then
echo "successssssssssssssssssss"
$filename = "<font color='red'>$i</font>"
else
echo "failureeeeeeeeeeeeeeeeeeeee"
$filename = "$i"
fi;
I'm just trying to see is this - read a file name and highlight... (2 Replies)
So I'm writing a script that takes in arguments given from the shell. The last argument I'm using as a tag to tell my script, via if statements, to do one thing or another. A sample input would be:
script.scr infile.txt outfile.txt F
The "F" at the end there I expect to be one of two tags... (3 Replies)
Discussion started by: Malavin
3 Replies
LEARN ABOUT SUNOS
echo
echo(1B) SunOS/BSD Compatibility Package Commands echo(1B)NAME
echo - echo arguments to standard output
SYNOPSIS
/usr/ucb/echo [-n] [argument]
DESCRIPTION
echo writes its arguments, separated by BLANKs and terminated by a NEWLINE, to the standard output.
echo is useful for producing diagnostics in command files and for sending known data into a pipe, and for displaying the contents of envi-
ronment variables.
For example, you can use echo to determine how many subdirectories below the root directory (/) is your current directory, as follows:
o echo your current-working-directory's full pathname
o pipe the output through tr to translate the path's embedded slash-characters into space-characters
o pipe that output through wc -w for a count of the names in your path.
example% /usr/bin/echo "echo $PWD | tr '/' ' ' | wc -w"
See tr(1) and wc(1) for their functionality.
The shells csh(1), ksh(1), and sh(1), each have an echo built-in command, which, by default, will have precedence, and will be invoked if
the user calls echo without a full pathname. /usr/ucb/echo and csh's echo() have an -n option, but do not understand back-slashed escape
characters. sh's echo(), ksh's echo(), and /usr/bin/echo, on the other hand, understand the black-slashed escape characters, and ksh's
echo() also understands a as the audible bell character; however, these commands do not have an -n option.
OPTIONS -n Do not add the NEWLINE to the output.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWscpu |
+-----------------------------+-----------------------------+
SEE ALSO csh(1), echo(1), ksh(1), sh(1), tr(1), wc(1), attributes(5)NOTES
The -n option is a transition aid for BSD applications, and may not be supported in future releases.
SunOS 5.10 3 Aug 1994 echo(1B)