10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Trying to change the prompt. I have the following code.
export PS1='
<${USER}@`hostname -s`>$ '
The hostname is not displayed
<abc@`hostname -s`>$ uname -a
AIX xyz 1 6 00F736154C00
<adcwl4h@`hostname -s`>$
If I use double quotes, then the hostname is printed properly but... (3 Replies)
Discussion started by: bobbygsk
3 Replies
2. Shell Programming and Scripting
AIX 6.1
bash shell
#!/bin/bash -x
STATEMENT="cvs commit -m \"This is\" ../PBP/EIR.ENTRY"
echo $STATEMENT
exit 0
This is the output
+ STATEMENT='cvs commit -m "This is" ../PBP/EIR.ENTRY'
+ echo cvs commit -m '"This' 'is"' ../PBP/EIR.ENTRY
cvs commit -m "This is" ../PBP/EIR.ENTRY
+ exit... (26 Replies)
Discussion started by: hpodhrad
26 Replies
3. Shell Programming and Scripting
hi folks,
please help me with this, my bash script is not recognizing veritas cluster commands, giving error such as "bash: hastatus: command not found".
the piece of code is
ssh -p 22022 test02 'hastatus -sum |grep j2ee|grep -i online' > /tmp/j2ee.log (2 Replies)
Discussion started by: gauravsharma29
2 Replies
4. Shell Programming and Scripting
Hello. I'm trying to write a bash script that uses GNU screen and have hit a brick wall that has cost me many hours... (I'm sure it has something to do with quoting/globbing, which is why I post it here)
I can make a script that does the following just fine:
test.sh:
#!/bin/bash
# make... (2 Replies)
Discussion started by: jondecker76
2 Replies
5. Shell Programming and Scripting
Hi I want to replace single quote with two single quotes in a perl string.
If the string is <It's Simpson's book> It should become <It''s Simpson''s book> (3 Replies)
Discussion started by: DushyantG
3 Replies
6. UNIX for Dummies Questions & Answers
Unix superusers,
I am new to unix but would like to learn more about grep. I am very familiar with regular expressions as i have used them for searching text files in windows based text editors. Since I am not very familiar with Unix, I dont understand when one should use GREP with the... (2 Replies)
Discussion started by: george_vandelet
2 Replies
7. Shell Programming and Scripting
Hi guys, I have a sed line in double quotes which works fine, but I want it to be in single quotes
here is the sed line
sed "/abc_def/s/\'.*\'/\'\${abc_def}\'/"
can some one give the equivalent to the above script in single quotes
Thanks a ton (5 Replies)
Discussion started by: sol_nov
5 Replies
8. Shell Programming and Scripting
I'm not very familiar with the ssh command. When I tried to set a variable and then echo its value on a remote machine via ssh, I found a problem. For example,
$ ITSME=itsme
$ ssh xxx.xxxx.xxx.xxx "ITSME=itsyou; echo $ITSME"
itsme
$ ssh xxx.xxxx.xxx.xxx 'ITSME=itsyou; echo $ITSME'
itsyou
$... (3 Replies)
Discussion started by: password636
3 Replies
9. Shell Programming and Scripting
Hi,
Please help me to echo the following statement using single quotes
Why can't I write 's between single quotes
Thanks in advance,
Chella (3 Replies)
Discussion started by: chella
3 Replies
10. Shell Programming and Scripting
Hi ,
I am passing a variable site_name from a shellscript to an SQL script and then I want to spool an sql query on to my Unix box and generate a CSV file.
Everything works fine but I have to give quotes to the variable '&&site_name' in spool statement ..if i remove the quotes it generates an LST... (6 Replies)
Discussion started by: phani
6 Replies
SOCKATMARK(3) BSD Library Functions Manual SOCKATMARK(3)
NAME
sockatmark -- determine whether the read pointer is at the OOB mark
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/socket.h>
int
sockatmark(int s);
DESCRIPTION
To find out if the read pointer is currently pointing at the mark in the data stream, the sockatmark() function is provided. If sockatmark()
returns 1, the next read will return data after the mark. Otherwise (assuming out of band data has arrived), the next read will provide data
sent by the client prior to transmission of the out of band signal. The routine used in the remote login process to flush output on receipt
of an interrupt or quit signal is shown below. It reads the normal data up to the mark (to discard it), then reads the out-of-band byte.
#include <sys/socket.h>
...
oob()
{
int out = FWRITE, mark;
char waste[BUFSIZ];
/* flush local terminal output */
ioctl(1, TIOCFLUSH, (char *)&out);
for (;;) {
if ((mark = sockatmark(rem)) < 0) {
perror("sockatmark");
break;
}
if (mark)
break;
(void) read(rem, waste, sizeof (waste));
}
if (recv(rem, &mark, 1, MSG_OOB) < 0) {
perror("recv");
...
}
...
}
RETURN VALUES
Upon successful completion, the sockatmark() function returns the value 1 if the read pointer is pointing at the OOB mark, 0 if it is not.
Otherwise, the value -1 is returned and the global variable errno is set to indicate the error.
ERRORS
The sockatmark() call fails if:
[EBADF] The s argument is not a valid descriptor.
[ENOTTY] The s argument is a descriptor for a file, not a socket.
SEE ALSO
recv(2), send(2)
HISTORY
The sockatmark() function was introduced by IEEE Std 1003.1-2001 (``POSIX.1''), to standardize the historical SIOCATMARK ioctl(2). The
ENOTTY error instead of the usual ENOTSOCK is to match the historical behavior of SIOCATMARK.
BSD
October 13, 2002 BSD