hi all,
i'm new to shell scripting, so i'm not sure how to work this. Is it possible to read in the contents of a variable and add it to a command? for example:
------------------------
#!/bin/sh
set example = -dfr
rm ${example}
------------------------
when i run the script, i want... (2 Replies)
I want to save the contents of a variable to a file. How can that be achieved?
I have tried with:
echo $varname > textfile.txt
but for some reason it does not print anything. (1 Reply)
Hi ,
I have
#echo $var1
#hdisk2 hdisk3 hdisk0 hdisk2
Now I need to remove duplicate entries from this . ie. after sorting it should only have
hdisk2 hdisk3 hdisk0 .
I can have these values in a array as well . I understand we can use sort -u to remove the duplicates in a... (2 Replies)
Hello All,
I've written a script to collect all audit logs files; now i want to see only the files from it which contains certain x tablenames. I've stored all the tablenames in a log file and using it through variable in a script (ex:below)
$ more tablenames.log (this is just a samle... (2 Replies)
My file is in this format :
username : student information : default shell : student ID
Eg :
joeb:Joe Bennett:/bin/csh:1234
jerryd:Jerry Daniels:/bin/csh:2345
deaverm: Deaver Michelle:/bin/bash:4356
joseyg:Josey Guerra:/bin/bash:8767
michaelh:Michael Hall:/bin/ksh:1547
I have to... (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I have to read the contents of each field of a file creating user accounts.
The file will be of format :
... (6 Replies)
Hello, All. This is my first post here, and I expect that the answer is simple, but I can't find it. Might be the way I'm searching. I'm fairly new to Unix/Linux, and I'm writing a Korn Shell Script. I am trying to provide a value that is already in a variable to awk so that awk can pull out the... (3 Replies)
Hi one of the output of the command is as below
# sed -n "/CCM-ResourceHealthCheck:/,/---------/{/CCM-ResourceHealthCheck:/d;/---------/d;p;}" Automation.OutputZ$zoneCounter | sed 's/$/<br>/'
Resource List : <br>
*************************** 1. row ***************************<br>
... (2 Replies)
Hi All,
I was trying a shell script. I was unable to store file contents to a variable in the script. I have tried the below but unable to do it.
Input = `cat /path/op.diary`
Input = $(<op.diary)
I am using ksh shell. I want to store the 'op.diary' file contents to the variable 'Input'... (12 Replies)
Discussion started by: am24
12 Replies
LEARN ABOUT HPUX
mktemp
mktemp(1) General Commands Manual mktemp(1)NAME
mktemp - make a name for a temporary file
SYNOPSIS
directory_name] prefix]
DESCRIPTION
makes a name that is suitable for use as the pathname of a temporary file, and writes that name to the standard output. The name is chosen
such that it does not duplicate the name of an existing file. If the option is specified, a zero-length file is created with the generated
name.
The name generated by is the concatenation of a directory name, a slash the value of the environment variable truncated to - 6 characters,
and the process ID of the invoking process.
The directory name is chosen as follows:
1. If the option is specified, directory_name is used.
2. Otherwise, if the environment variable is set and a string that would yield a unique name can be obtained by using the value of
that variable as a directory name, this value is used.
3. Otherwise, if a string that would yield a unique name can be obtained using as the directory, is used.
4. Otherwise, (current directory) is used.
If the option is specified, prefix is used instead of the value of the environment variable for name generation.
RETURN VALUE
returns zero on successful completion and non-zero if syntax, file access, or file creation errors were encountered or a unique pathname
could not be generated.
SEE ALSO mktemp(3C), umask(1).
mktemp(1)