12-08-2008
what the %s does percent sign-s mean?
context:
while reading tutorial on the read command, one of the first examples, demonstrating its use, follows as such:
$ x=abc ; printf "x is now '%s'. Enter new value: " $x ; read x
generating this output:
x is now 'abc'. Enter new value:
first, what does %s represent? I know in this context that it will obviously reflect the value of the just-defined variable x ('abc') but outside of this context??? And if the author wanted to display this variable, why did he use %s instead of $x???
Also for bonus stickers, explain the reason for spaces around semi-colons. I've seen it before, but I know semi-colons to inject end-of-line or carriage-return signal so I know them to work without the preceding or ensuing space?? Is my grasp accurate/correct? Maybe distinguishing why spacing vs not spacing and its effects would explain to me.
many thanks in advance, party people of the internet!
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'd like to make a script that I can execute every time I sign on to my linux box that keeps track of the time and allows to me to add a remark to a file. So basically once I log in, I run the script, and it outputs the date and time to a text file (log.txt). But that isn't my problem.
I need... (1 Reply)
Discussion started by: Glider
1 Replies
2. Shell Programming and Scripting
Hi I'm new to this forum and I'm a beginner when it comes to shell and awk programming. But I have the following problem:
I have 5 csv files (data1.csv, data2.csv, etc.) and need to calculate the average between the total sum of the 1st and 7 column.
csv example:... (3 Replies)
Discussion started by: sapo51
3 Replies
3. Shell Programming and Scripting
hi everyone,
# cat a
a 10%
b 25.5%
c 91%
d 50%
# cat a | awk '$2 >= 90%; END {print $_}'
awk: $2 > 90%; END {print $_}
awk: ^ syntax error
awk: each rule must have a pattern or an action part
how to do only print when 2nd coln >= 90%.
Thanks (6 Replies)
Discussion started by: jimmy_y
6 Replies
4. HP-UX
I need to get a file size and compare it to a previous day file size. If it's larger or smaller by 50 percent I'll replace the new with the old. I know how to get the file sizes but do not know how to calculate if it's 50 percent difference.
Thanks for your help. (2 Replies)
Discussion started by: jkuchar747
2 Replies
5. Shell Programming and Scripting
Hii all,
If i insert zero percent tape in tivoli. Then tivoli will write data on it.
But zero percent tape has some files inside, its not a scratch tape.
Because if we recover data then tivoli can ask for zero percent tape.
But when tivoli will write data on a zero percent tape ... (0 Replies)
Discussion started by: uusmankhalil
0 Replies
6. UNIX for Dummies Questions & Answers
How to determine the total percentage cpu usage of a server having 4 cpu cores(quad core)? (3 Replies)
Discussion started by: proactiveaditya
3 Replies
7. Shell Programming and Scripting
Hello everyone,
I have two matrices at same sizes. I need to re-calculate the numbers in matrix A according to the percentages in martix B
it is like
matrix A is
10.00 20.00 30.00 40.00
60.00 70.00 80.00 90.00
20.00 30.00 80.00 50.00
martix B is
00.08 00.05 ... (2 Replies)
Discussion started by: miriammiriam
2 Replies
8. Shell Programming and Scripting
Trying to use file1 which is the actual counts in $2 associated with each $1 entry. The total of each $1 is in file2 with the total in $3. So when there is a match between $1 in file1 with $1 in file2, then the % is calculated using the $2 value of file1 and $3 value of file2. Thank you :).
... (4 Replies)
Discussion started by: cmccabe
4 Replies
9. Shell Programming and Scripting
I want the tomcat to restart when java goes 100% cpu utilize and remain on this , Get pid kill and start tomcat .
top | grep java
We can get pid and cpu utilize , But how can we do on run time.
Please use code tags as required by forum rules! (1 Reply)
Discussion started by: kaushik02018
1 Replies
LEARN ABOUT HPUX
fs_quota
FS_QUOTA(1) AFS Command Reference FS_QUOTA(1)
NAME
fs_quota - Displays the quota used in the volume containing a directory or file
SYNOPSIS
fs quota [-path <dir/file path>+] [-help]
fs q [-p <dir/file path>+] [-h]
DESCRIPTION
The fs quota command displays the percent of quota consumed in the volume that contains each specified directory or file.
To display more detailed information about the volume and the partition it resides on, use the fs examine and fs listquota commands.
To set volume quota, use the fs setquota or fs setvol command.
CAUTIONS
Currently, the maximum size of a volume is 2 terabytes (2^31 bytes).
OPTIONS
-path <dir/file path>
Names each file or directory for which to display the quota consumed in its parent volume. Partial pathnames are interpreted relative
to the current working directory, which is also the default value if this argument is omitted.
-help
Prints the online help for this command. All other valid options are ignored.
OUTPUT
The output reports the percent of volume quota used, in the following format:
<percent>% of quota used.
EXAMPLES
The following command lists the percent quota used of the volume housing the current working directory:
% fs quota
17% of quota used.
The following command lists the percent quota used of both the volume housing the current working directory's parent directory and the
volume housing the directory /afs/abc.com/usr/smith:
% fs quota -path .. /afs/abc.com/usr/smith
43% of quota used.
92% of quota used.
PRIVILEGE REQUIRED
The issuer must have the "r" (read) permission on the ACL of the root directory of the volume that houses the file or directory named by
the -path argument, and "l" (list) permission on the ACL of each directory that precedes it in the pathname.
SEE ALSO
fs_examine(1), fs_listquota(1), fs_setquota(1), fs_setvol(1)
COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas
Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.
OpenAFS 2012-03-26 FS_QUOTA(1)