03-03-2010
Right. The tilde was just in my test script. I can put in any directory and I get equally strange results. I tried /tmp and got nothing. I tried the root directory and got 3 files. It seems erratic.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am writing a shell script.
Now i need to read in a string and send it to an awk file to compare and search for compatible record.
I wrote it like tat:
read serial | awk -f generate.awk data.dat
p/s: the data file got 6 field.
According to an expert, we can write it like tat:
read... (1 Reply)
Discussion started by: AkumaTay
1 Replies
2. Shell Programming and Scripting
Greetings,
I am wrapping the monitoring commands like vmstat, sar, iostat and call via arguments
I want ./unix_stats.sh -v vmstat -p <SEC> -d <Duration>
to give vmstat values, and similarly iostat etc.,.
Also if I give ./unix_stats.sh -v vmstat -i iostat -p <SEC> -d <Duration> should give... (4 Replies)
Discussion started by: A_Rod
4 Replies
3. Shell Programming and Scripting
Hi all,
I'm new to Shell scripting. In my shell script for Bourne shell, the script accepts a date parameter which is optional. If the value is supplied, the supplied value should be assigned to a variable. If not, the current date will be assigned to the variable. My script is like this.
#!... (9 Replies)
Discussion started by: sumesh.abraham
9 Replies
4. Shell Programming and Scripting
i'm trying to pass a numerical argument with function xyz to print specfic lines of filename, but my 'awk' syntax is incorrect.
ie
xyx 3 (prints the 3rd line, separated by ':' of filename)
function xyz() {
arg1=$1
cat filename | awk -F: -v x=$arg1 '{print $x}'
}
any ideas? (4 Replies)
Discussion started by: prkfriryce
4 Replies
5. Shell Programming and Scripting
Hell all,
i have a problem in argument passing.
print()
{
a=$1
b=$2
c=$3
echo $a
echo $b
echo $c
}
x="1 2 3"
y="4 5 6"
z="7 8 9"
print $x $y $z. (4 Replies)
Discussion started by: tsaravanan
4 Replies
6. Shell Programming and Scripting
Hi all
I have got a file digits.data containing the following data
1 3 4
2 4 9
7 3 1
7 3 10
I am writing a script that will pass an argument from C-shell to nawk command. But it seems the values in the nawk comman does not get set. the program does not print no values out. Here is the... (1 Reply)
Discussion started by: ganiel24
1 Replies
7. Shell Programming and Scripting
So, I have this script. It reads a CSV file that has a mixture of object names with IP addresses (parsing out that part I have working), and object names which have a DNS name. I want to be able to run a "dig +short" based off of the name given to me in the line of the awk script, and then deal... (6 Replies)
Discussion started by: mikesimone
6 Replies
8. Shell Programming and Scripting
I have one working awk command line. Which taking data from the “J1202523.TXT” file and generating the “brazil.dat” file. PFB code.
awk '{ DUNS = substr($0,0,9);if ( substr($0,14,3) == "089" ) print DUNS }' J1202523.TXT > Brazil.dat
But now I want to pass two parameter as a command line argument... (4 Replies)
Discussion started by: humaemo
4 Replies
9. Shell Programming and Scripting
I have the awk script below and things go wrong when I do
awk -v dsrmx=25 -f ./checkSRDry.awk --usage
I basically want to override the usual --usage and --help that awk gives.
How do people usually handle this situation when you also want to supply your own usage and help
concerning the... (2 Replies)
Discussion started by: kristinu
2 Replies
10. Shell Programming and Scripting
consider the script below
sh /opt/hqe/hqapi1-client-5.0.0/bin/hqapi.sh alert list --host=localhost --port=7443 --user=hqadmin --password=hqadmin --secure=true >/tmp/alerts.xml
awk -F'' '{for(i=1;i<=NF;i++){
if($i=="Alert id") {
if(id!="")
if(dt!=""){
cmd="sh someScript.sh... (2 Replies)
Discussion started by: vivek d r
2 Replies
LEARN ABOUT DEBIAN
fnqualify
FNQUALIFY(3pub) C Programmer's Manual FNQUALIFY(3pub)
NAME
fnqualify - qualify a filename
SYNOPSIS
#include <publib.h>
size_t fnqualify(char *result, const char *path, size_t max);
DESCRIPTION
fname_qualify qualifies a filename. This means that if the input name is not an absolute name (i.e. starts from the root directory, e.g.
is foo, not /tmp/foo), the current directory will be prepended to it. Also, tilde conversion is done: if the filename begins with a tilde
(~), the tilde is replaced with the home directory of the user, and if it begins with a tilde and a username, both are replaced with the
home directory of the given user.
Simplifications like replacing /./ with /, and /foo/../bar with /bar are not done because of problems with symbolic links.
RETURNS
The function returns -1 if there was some error, or the total size of the full name otherwise. The return value may be greater than the
maximum size given by the last argument; only as much as allowed by that is actually written, though.
SEE ALSO
publib(3), fname(3)
AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi)
Publib C Programmer's Manual FNQUALIFY(3pub)