11-25-2014
I'd recommend updating tot he latest version. 14 is a very long way behind.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I'm writing a script and I've put #!/bin/bash as the first line so that I can just type my scripts name 'whodate' at PS1 instead of ./whodate. This has suddenly stopped working for me. It used to be the case that I could start a script with #!/bin/bash and it would work, but for this script... (2 Replies)
Discussion started by: zorrokan
2 Replies
2. Shell Programming and Scripting
i have this code for a simple if loop:
#!/bin/bash
array="1 2 3 4 5"
array2="5 6 7 8 9"
if } -gt ${array} ]; then
echo "${array2} is greater than ${array}!!"
fi
the error is
./script8: line 9: [: too many arguments
./script8: line 9: [: too many arguments
./script8: line 9: [:... (10 Replies)
Discussion started by: npatwardhan
10 Replies
3. Shell Programming and Scripting
So I need a script that does the following:
If a certain user is logged in
Run `command`
Else
Echo “incorrect user”
This is my first stab...which doesn't work:
#!/bin/bash
X="user=`ls -l /dev/console | cut -d " " -f 4`"
Y="foobar"
echo $X
echo $Y (4 Replies)
Discussion started by: doubleminus
4 Replies
4. Shell Programming and Scripting
Hi Friends,
I am presently migrating shell scripts writter in KSH to SH.I am stuck at this place and i am not able to find a work around:-
Let the script name is x.sh
Below are some of the codes in it...
export abc=hello
export abc=hi
export abc=how
When i am trying to compile the script ... (6 Replies)
Discussion started by: amit.behera
6 Replies
5. HP-UX
Why Bash is not working in HP-UX ?
What is similiar exe which is in HP_UX as Bash? (9 Replies)
Discussion started by: girija
9 Replies
6. Shell Programming and Scripting
Hello all,
I'm trying to substract 1 minute from the current date and take the hour and minute (for filename purpose).
1) If I want hour an minute from current time I can use:
timetmp=$(date +"%H:%M")
2) To substract 1 minute from current time I can use:
timetmp=$(date --date "$dte -1... (8 Replies)
Discussion started by: Lord Spectre
8 Replies
7. Shell Programming and Scripting
Hi friends,
I have two files - input and commands
I want to read the input and replace a value in it with the contents in commands.
My script is like this.
Instead of printing the value in the commands file, it is simply printing $cmd in the output file.
Any pointers are highly... (1 Reply)
Discussion started by: jacobs.smith
1 Replies
8. Shell Programming and Scripting
Hi, I am currently working on a Bash shell script that
- Downloads a webpage, in this case youtube.com
- Extracts Number of views, Extracts Title of video, Extracts User who made it, and lastly Duration. Then I have to Out put this into columns.
To me this sounds like crazyness. I'm very new... (6 Replies)
Discussion started by: Njzangel
6 Replies
9. Shell Programming and Scripting
How to run several bash commands put in bash command line without needing and requiring a script file.
Because I'm actually a windows guy and new here so for illustration is sort of :
$ bash "echo ${PATH} & echo have a nice day!"
will do output, for example:... (4 Replies)
Discussion started by: abdulbadii
4 Replies
10. Programming
Ahoy friends.
Currently i got a bash script running to manage my minecraft servers.
All of them are stored in /home/minecraft_servers directory.
Using my script im able to start a server (e.g. ./minecraft start ftb_continuum) because server name and server name are the same.(e.g.... (2 Replies)
Discussion started by: Knogle
2 Replies
GETW(3) Linux Programmer's Manual GETW(3)
NAME
getw, putw - input and output of words (ints)
SYNOPSIS
#include <stdio.h>
int getw(FILE *stream);
int putw(int w, FILE *stream);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
getw(), putw():
Since glibc 2.3.3:
_XOPEN_SOURCE && ! (_POSIX_C_SOURCE >= 200112L)
|| /* Glibc since 2.19: */ _DEFAULT_SOURCE
|| /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
Before glibc 2.3.3:
_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE
DESCRIPTION
getw() reads a word (that is, an int) from stream. It's provided for compatibility with SVr4. We recommend you use fread(3) instead.
putw() writes the word w (that is, an int) to stream. It is provided for compatibility with SVr4, but we recommend you use fwrite(3)
instead.
RETURN VALUE
Normally, getw() returns the word read, and putw() returns 0. On error, they return EOF.
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
+---------------+---------------+---------+
|Interface | Attribute | Value |
+---------------+---------------+---------+
|getw(), putw() | Thread safety | MT-Safe |
+---------------+---------------+---------+
CONFORMING TO
SVr4, SUSv2. Not present in POSIX.1.
BUGS
The value returned on error is also a legitimate data value. ferror(3) can be used to distinguish between the two cases.
SEE ALSO
ferror(3), fread(3), fwrite(3), getc(3), putc(3)
COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
GNU
2016-03-15 GETW(3)