11-08-2012
Seems a bit sloppy to me. Wouldn't it just be better to check if the file exists first?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hello
whats the difference between excuting a shell script as
a)sh myscript.sh
b). ./myscript.sh
i noticed that my shell script works fine when i run it as . ./myscript
.sh but fails when i run it as sh myscript.sh could anybody explain why.
the shell script is very simple
... (9 Replies)
Discussion started by: xiamin
9 Replies
2. AIX
Ho do I find out the verion of the Kron shell on my client`s system ?
There is no one to ask. They are not knowledged enough (hard to believe but yes).
Also, on that AIX 4.2, I am trying to figure out how to do a grep using a search patter like below but does not seam to work. The '*' do... (11 Replies)
Discussion started by: Browser_ice
11 Replies
3. Shell Programming and Scripting
Hello,
I am a bit puzzled by the way my shell treats spaces in filenames.
An example will be way clearer than any explanation I can make:
$ ls test\ file\ with\ spaces
test file with spaces
$ var="test\ file\ with\ spaces"
$ echo $var
test\ file\ with\ spaces
$ ls $var
ls: cannot... (4 Replies)
Discussion started by: SDelroen
4 Replies
4. Shell Programming and Scripting
In a Korn shell script I have,
cat ../header | sed -e 's/flag1/$cnumb/g' > header.txt
The header is short
{{Company flag1}}
But the result in header.txt is
{{Company $cnumb}}
The value of $cnumb is 120. I am trying to get the value of $cnumb into the header.
I have tried /'$cnumb'/g,... (10 Replies)
Discussion started by: jcarrott
10 Replies
5. UNIX for Dummies Questions & Answers
Hi
Don't know if this is a dummy question, but let's give it a try.
I yesterday had a problem with undefined behaviour in the sort shell command (I'm using bash), leading to different sort orders without apparent reasons. I resolved this by typing
export LC_ALL="C"
export LC_COLLATE="C"... (5 Replies)
Discussion started by: jossojjos
5 Replies
6. UNIX for Dummies Questions & Answers
Hi all,
Can someone point me in the right direction for a manual on the various statement options for 'if'. Basically I have a piece of code which says:
if ]
and I wondered what the -f was. I know the '!' means not equal..
As usual any help much appreciated.. (5 Replies)
Discussion started by: Grueben
5 Replies
7. Shell Programming and Scripting
Guys, please help! I am currently using an AIX server however whenever I tried to use the typeset -F3, the variable is resulting with a "#".
In the given example below, I declared x to be a decimal holding 3 decimal places = 1.455. However whenever I tried to echo the $x, the resulting value... (9 Replies)
Discussion started by: zzavilz
9 Replies
8. Shell Programming and Scripting
Hello all. This is my first post/question on this site.
I’m a new Systems Analyst with previous experience with BASH. Although now I'm using AIX, and I’m trying to get a feel for the Korn shell (for those of you that don’t know AIX only uses the KORN shell).
I hope I put this into the correct... (10 Replies)
Discussion started by: sydox
10 Replies
9. Shell Programming and Scripting
Hi there.
I'm facing a strange & an intriguing behaviour with sed while replacing the tab character with a space reading from a file. It randomly works sometimes but mostly doesn't work.
Below is what's happening-
<tab> here is the actual literal tab.
user1> cat temp2
1<tab>2<tab>3 4... (2 Replies)
Discussion started by: Deepak.Dhami
2 Replies
10. Shell Programming and Scripting
Can someone please explain the strange behaviour.. I was just trying a few things to learn awk..
in the below code when I start the braces in the same line, the output is as expected, when I start at next line, output is displayed twice.
Please see the file, code I tried and output below.
... (2 Replies)
Discussion started by: Kulasekar
2 Replies
LEARN ABOUT HPUX
elf32_getehdr
elf_getehdr(3E) elf_getehdr(3E)
NAME
elf_getehdr: elf32_getehdr(), elf32_newehdr(), elf64_getehdr(), elf64_newehdr() - retrieve class-dependent object file header for elf32 or
elf64 file
SYNOPSIS
Command: [flag]... file... [library]...
DESCRIPTION
32-bit Class File
For a 32-bit class file, returns a pointer to an ELF header, if one is available for the ELF descriptor elf. If no header exists for the
descriptor, allocates a "clean" one, but it otherwise behaves the same as It does not allocate a new header if one exists already. If no
header exists (for one cannot be created (for a system error occurs, the file is not a 32-bit class file, or elf is null, both functions
return a null pointer. The header includes the following members.
automatically sets the bit (see elf_flag(3E)). A program may use to inspect the identification bytes from a file.
64-bit Class File
For a 64-bit class file, returns a pointer to an ELF header, if one is available for the ELF descriptor elf. If no header exists for the
descriptor, allocates a "clean" one, but it otherwise behaves the same as It does not allocate a new header if one exists already. If no
header exists (for one cannot be created (for a system error occurs, the file is not a 64-bit class file, or elf is null, both functions
return a null pointer. The header includes the following members.
automatically sets the bit (see elf_flag(3E)). A program may use to inspect the identification bytes from a file.
SEE ALSO
elf(3E), elf_begin(3E), elf_flag(3E), elf_getident(3E).
elf_getehdr(3E)