02-26-2010
Thank you both for the explanation. Also, thanks for the example, i think i can get that to work.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all
How can I setup my shell so that I run a set of commmands or a script every time I login. I am using kshell. I tried putting a line in ./.bash_profile (does not work)
Ex.: I want to use vi as the commandline editor so, I want to run the command: set -o vi (3 Replies)
Discussion started by: skotapal
3 Replies
2. Shell Programming and Scripting
I'm new to unix and I have a fairly simple problem:
Lets say I am in a specific directory and I run the command: "dirs" ,
I get an output of all the folders that i pushed into the stack (as expected),
buut,
when when I create a script (called test):
#! /bin/csh
dirs
and then i run:... (2 Replies)
Discussion started by: owijust
2 Replies
3. Shell Programming and Scripting
Hello,
We have a requirement to disable running shell commands via vi using "!".
Can anybody please suggest how to disable this option.
The requirement arises because we open up a xterm window with a config file in vi mode for the customer to edit. After the customer edits the config... (1 Reply)
Discussion started by: Umesh_Sharoff
1 Replies
4. Shell Programming and Scripting
Hello all!
I have two consoles.I know the PID of these two.Now I want to execute a command in console#1 but from console#2. How can I achieve this?
Anyone can do something for my query?
Click here if you can't understand my query or to know the need for this query. (3 Replies)
Discussion started by: rakabarp
3 Replies
5. Programming
Hi guys,
I know using system() we can run unix commands but the problem is, I can't get any returns with the system(). I am returning stuff from my shell scripts that I need to be able to read from my C code.
Anybody has cure to this problem? :))
Thanks (2 Replies)
Discussion started by: alirezan
2 Replies
6. UNIX for Dummies Questions & Answers
hi!
how do i run 2 command from the same line
e.g: 'which screen' and then ls -la 'which screen' (4 Replies)
Discussion started by: rdns
4 Replies
7. Shell Programming and Scripting
Hello
I need to run some sed commands but it involves "/" in the substitute or delete, any ideas how I get round the problem.
Example:
cat file1.txt | sed -e '/</Header>/d' > file2.txt
This errors due to the forward slash before the Header text.
Thanks (3 Replies)
Discussion started by: Dolph
3 Replies
8. Shell Programming and Scripting
I need an if code in shell script where it should continue to further commands after succesfully installing the executable file.
i.e. /run installer is continuing but in the middle it executes further commands like "cp /root/user which were given after /run installer.
I want /runinstaller... (16 Replies)
Discussion started by: sriki32
16 Replies
9. UNIX for Dummies Questions & Answers
Is there any way in a script to print out the commands being ran? In DOS script, there is the "@echo on" and "@echo off".
so I have a script like this:
#!/bin/ksh
echo "hello there. moving files."
<turn on echoing here>
cp thisfile.txt thatfile.txt
cp whatfile.prop whyfile.prop
<turn... (2 Replies)
Discussion started by: ronron5477
2 Replies
10. Shell Programming and Scripting
Hi I want to run two commands in background, i am using below way, but it is not working, i m calling these two commands from one script to another server where below commands are running, in my script ssh is working fine, but command is not going in background, please advise what should i do.
... (10 Replies)
Discussion started by: learnbash
10 Replies
LEARN ABOUT DEBIAN
explain_time_or_die
explain_time_or_die(3) Library Functions Manual explain_time_or_die(3)
NAME
explain_time_or_die - get time in seconds and report errors
SYNOPSIS
#include <libexplain/time.h>
time_t explain_time_or_die(time_t *t);
time_t explain_time_on_error(time_t *t);
DESCRIPTION
The explain_time_or_die function is used to call the time(2) system call. On failure an explanation will be printed to stderr, obtained
from the explain_time(3) function, and then the process terminates by calling exit(EXIT_FAILURE).
The explain_time_on_error function is used to call the time(2) system call. On failure an explanation will be printed to stderr, obtained
from the explain_time(3) function, but still returns to the caller.
t The t, exactly as to be passed to the time(2) system call.
RETURN VALUE
The explain_time_or_die function only returns on success, see time(2) for more information. On failure, prints an explanation and exits, it
does not return.
The explain_time_on_error function always returns the value return by the wrapped time(2) system call.
EXAMPLE
The explain_time_or_die function is intended to be used in a fashion similar to the following example:
time_t result = explain_time_or_die(t);
SEE ALSO
time(2) get time in seconds
explain_time(3)
explain time(2) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2009 Peter Miller
explain_time_or_die(3)