Sponsored Content
Full Discussion: Spot the difference
Top Forums Shell Programming and Scripting Spot the difference Post 302082104 by Dim-Wit on Monday 31st of July 2006 09:33:32 AM
Old 07-31-2006
Spot the difference

I posted earlier with a problem it's here, I have edited the script a little and it tells me once more that the end of line is unexpected and I'm really lost with this one, thanks for any help.

The new version:

#!/bin/sh
case $# in
0) echo "Usage: enshar filename1 filename2 [...]" >&2
;;
*) for file
do
if [ -d $file ]
then echo "enshar: $file is a directory" >&2
elif [ ! -f $file ]
then echo "enshar: $file does not exist" >&2
elif [ ! -r $file ]
then echo "enshar: $file is not readable" >&2
elif [ -h $file ]
then echo "enshar: $file cannot enshar" >&2
exit n
else
echo "\!EnShAr!\"
set '"cksum" $file'
"test $1 = nnnnnnnnnn || echo $0: bad cksum in $file << '\!EnShAr!\'"
cat $file
fi
done
;;
esac
 

7 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Spot

does somebody know about SPOT ?? any link about SPOT commands ? i ve made a mistake during configuration, :mad: then i ve started the system in Maintenance mode the only shell was SPOT. :eek: SPOT doesn t understand anything.... how do i work with SPOT ? thanks in advance Karine... :D (1 Reply)
Discussion started by: karine
1 Replies

2. AIX

SPOT requirement

Hey May be a dumb question Can I use a SPOT which is at 5.3 TL6 to boot an LPAR (with 5.3 TL8) in to maintenance mode? Will it work ? Is it mandatory that SPOT should be of same or higher version in such case? Bala (1 Reply)
Discussion started by: balaji_prk
1 Replies

3. Shell Programming and Scripting

How do I search with regex in one spot?

Hello im new here and i shot stright with question. Mainly i wanna ask , how do i search with regexp in one spot and show the whole thing, what im trying to ask is , for eg. i do ls -l, and i see all the info for the dirs and dats. now say i wanna get all the dats that in their name they start... (2 Replies)
Discussion started by: Goroner
2 Replies

4. AIX

how to make a spot

HI. there My 10 servers are running on 6.1-05-03 aix including NIM server but my user want to update a TL (61-05-03 to 61-06-04) if I Update a AIx version of TL .. is that change the SPOT of NIM server.. OR if I make a spot of AIX7.1 and Is that support AIX 6.1 AIX 5.3 Images I... (1 Reply)
Discussion started by: Jeon Jun Seok
1 Replies

5. AIX

NIM SPOT query

Dear Admins, The SPOT defined in NIM is for aix 5.3 TL 7 . Some of the NIM clients are upgraded to TL 10 . Now the SPOT level is older than the mksysb level. This will cause problem during restoration of any NIM clients. Now i want to upgrade SPOT level to TL 10 and redefine the resources... (3 Replies)
Discussion started by: newaix
3 Replies

6. UNIX for Dummies Questions & Answers

Can anyone help me to spot my mistake?

Hi there can anyone help me to spot my mistake and please explain why it appears My code : #!/usr/bin/gawk -f BEGIN { bytes =0} { temp=$(grep "datafeed\.php" | cut -d" " -f8) bytes += temp} END { printf "Number of bytes: %d\n", bytes } when I am running ./q411 an411 an411: ... (6 Replies)
Discussion started by: FUTURE_EINSTEIN
6 Replies

7. AIX

Unable to create a SPOT

Hi everyone! Ok so I'm trying for the first time to install AIX on a LPAR with NIM. The NIM: root@oaexpnimp01(/home/root) # oslevel -s 6100-08-02-1316 I'm trying to install AIX 6.1 TL1. I successfully created a new lpp source root@oaexpnimp01(/home/root) # lsnim -l AIX61_TL1_2... (10 Replies)
Discussion started by: trivium012
10 Replies
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)
All times are GMT -4. The time now is 09:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy