Search Results

Search: Posts Made By: DoxieLvr
3,616
Posted By DoxieLvr
I am confused. if the tarball contained the file...
I am confused. if the tarball contained the file "remote_file.txt" then
tar -C /local/server/destination/path/un-tar -zxvf /local/server/source/path/remote_file.txt.tar.gz stage_file.txtshould not...
6,090
Posted By DoxieLvr
It's hard to tell for sure but it looks like one...
It's hard to tell for sure but it looks like one is end-one and the other is end-lower-case-ell. Make sure they really match.
6,450
Posted By DoxieLvr
This is a bit of a kludge, using a temporary file...
This is a bit of a kludge, using a temporary file to hold the exit status, but it works:

(ls abc 2>&1; echo $? > tmpfile.$$) | tee log; cat tmpfile.$$; rm -f tmpfile.$$
5,958
Posted By DoxieLvr
Another way to look at it is as follows: ...
Another way to look at it is as follows:

CR-LF are the actual bytes that would be sent over a serial port to most terminal devices. Microsoft, originally with DOS, chose to put those characters...
Forum: Programming 03-30-2011
2,322
Posted By DoxieLvr
If you are planning to use that as a TCP port...
If you are planning to use that as a TCP port number in sin_port in a sockaddr_in struct, you should be aware that this is a 16-bit unsigned integer and is limited to 65536. In this case, leave it a...
1,911
Posted By DoxieLvr
The redirection (> abc.dat) is set up by the...
The redirection (> abc.dat) is set up by the shell well before the cut program is executed. This replaces abc.dat with an empty file which cut then opens for input also.

You need to do something...
6,778
Posted By DoxieLvr
No. . ./my_script.kshexecutes the script within...
No.
. ./my_script.kshexecutes the script within your current (probably login) shell. sh my_script.ksh creates a new shell in a child process and executes within that. Neither of them obeys the...
Forum: Programming 03-19-2011
8,184
Posted By DoxieLvr
There is no parent process and child process in...
There is no parent process and child process in the code snippet you posted.

execl replaces the current program with a new one (in this case "/bin/sh"), all in the same process. By the time that...
7,013
Posted By DoxieLvr
try if [ "$val" -eq "$val" 2> /dev/null ]; then...
try
if [ "$val" -eq "$val" 2> /dev/null ]; then
echo "is number"
else
echo "not number"
fiThe redirect hides the error message.
Forum: Programming 03-13-2011
1,690
Posted By DoxieLvr
I'm going to read between the lines and assume...
I'm going to read between the lines and assume that you want to output to stderr within a script so that if you run the script with stderr redirected to a file, that output goes to the file.

The...
1,349
Posted By DoxieLvr
On Linux, if you delete ("unlink") a file while...
On Linux, if you delete ("unlink") a file while a process has it open, all that happens is that the directory entry is removed but the file itself remains until the process closes the...
3,761
Posted By DoxieLvr
How about var4=$(printf "%s\n%s" $var1...
How about
var4=$(printf "%s\n%s" $var1 $var2)
9,615
Posted By DoxieLvr
man 1 unbuffer
man 1 unbuffer
Forum: Programming 12-05-2010
3,691
Posted By DoxieLvr
The problem is that a valid address running one...
The problem is that a valid address running one process may not be valid/available in another. In fact, an address that may be valid on one system may not be valid on another system. That's why it...
2,851
Posted By DoxieLvr
Actually, AFAIK, system calls such as open(2)...
Actually, AFAIK, system calls such as open(2) ignore consecutive slashes. I don't think this has anything to do with shells, and I wouldn't expect a shell to modify or complain about consecutive...
2,187
Posted By DoxieLvr
You can also use the "-o" option to select which...
You can also use the "-o" option to select which fields are output. For example:
ps -opid,ppid,cmdlists the PID, parent PID and command line.
Forum: Programming 10-21-2010
7,138
Posted By DoxieLvr
You're doing sprintf to buf but writing the...
You're doing sprintf to buf but writing the original variable "a" which contains the binary representation of the number.

Change
write(ter,a,sizeof(a));
to
write(ter,buf,strlen(buf));
Note to...
2,534
Posted By DoxieLvr
man 3 strsignal?
man 3 strsignal?
17,206
Posted By DoxieLvr
"-eq" is for comparing integers. Use "="...
"-eq" is for comparing integers. Use "=" instead:
if [ "${3}" = "-t" ] then

BTW, please use "CODE" tags when posting something like a script. It makes it much easier to read.
7,171
Posted By DoxieLvr
Correct me if I'm wrong, but doesn't the shebang...
Correct me if I'm wrong, but doesn't the shebang not work with the space after the pound-sign? It seems to me that the script isn't running in bash but whatever the OP's default shell is.

I'd try...
8,905
Posted By DoxieLvr
You are trying to fork your second child process...
You are trying to fork your second child process from the first child process, not from the original parent. The main problem is that execv() never returns and so the second fork does not execute. ...
11,621
Posted By DoxieLvr
First, you need to read the man page on...
First, you need to read the man page on system(3). The return value is of the format returned by wait(2). Thus, you need to feed that into the WEXITSTATUS macro to get the actual return value.
...
1,779
Posted By DoxieLvr
Nevermind. I misread the question.
Nevermind. I misread the question.
29,440
Posted By DoxieLvr
I would also note that a file pointer has an...
I would also note that a file pointer has an associated file descriptor used by the library functions to do the actual I/O calls to the kernel. You can get the associated fd using the fileno...
2,215
Posted By DoxieLvr
The problem is that the shell isn't even looking...
The problem is that the shell isn't even looking at the output of your first command. The shell's fd for stdout is simply being copied into the subprocess that is running find/aptitude/etc. and that...
Showing results 1 to 25 of 32

 
All times are GMT -4. The time now is 12:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy