10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a script that checks if the script has been ran with sudo.
If the script is not ran as sudo, the current script is being executed with exec sudo bash.
You are asked for a password, you type in the password, success. Everything is perfect - the commands inside the script are ran as sudo.... (1 Reply)
Discussion started by: boqsc
1 Replies
2. UNIX for Dummies Questions & Answers
Ksh is my default shell, but I want use the bash shell since its convenient to me.
When I type a long command line in a terminal, it does not wrap to the next line when I reach the end of the line and it wraps onto the same line, overwriting my prompt and the rest of what I typed.
$... (5 Replies)
Discussion started by: senthil.ak
5 Replies
3. Shell Programming and Scripting
I have a script that writes another script with
cat >/usr/local/bin/myscript.sh <<EOF
#!/bin/sh
VAR=`run a command here`
EOF
Problem is, after this is run, I get:
$ cat /usr/local/bin/myscript.sh
#!/bin/sh
VAR=result of command
How do I stop that from happening with Macs... (2 Replies)
Discussion started by: jnojr
2 Replies
4. Programming
Hi, I do the following:
i) malloc some parameter structures
ii) fork
iii) in the child, I call execvp using these parameters
obviously, here I can never free() the structures as execvp should not return
iiii) I am currently doing waitpid in parent then freeing, but this does not seem to work... (1 Reply)
Discussion started by: misha680
1 Replies
5. Shell Programming and Scripting
Hi,
I want to run these two commands one after the other.
awk 'BEGIN {OFS="\t"} {print $2}'
sort -u
rather than typing awk 'BEGIN {OFS="\t"} {print $2}' file1 > file2, then sort -u file2 > file3. Is it possible to run both commands on file1 then get output file3?
Its kinda hard for... (5 Replies)
Discussion started by: kylle345
5 Replies
6. Red Hat
Hi Folks,
I have a small doubt, the binary commands under /bin and /sbin as well as other path binary files, if you peek deep into that, you can find the difference in the way of normal perl programming and some commands will be like binary files. how are the commands executing like the... (3 Replies)
Discussion started by: gsiva
3 Replies
7. Shell Programming and Scripting
I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config.
I am not sure if I can do this with BASH scripting.
I have set up password less login by adding my public key to authorized_keys file, it works.
I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies
8. Shell Programming and Scripting
In a BASH library I'm creating, I have two functions that look like:
function check_process {
PIDFILE=$1
if ; then
PID=`cat $PIDFILE`
if && ; then
return 1
fi;
fi;
return 0
}
function fork_process {
CMD=$1
PIDFILE=$2
... (2 Replies)
Discussion started by: neked
2 Replies
9. Programming
Hi ,
I m actually trying to implement pipes program,but after executing the execvp(),my program is getting hanged up :mad:
Actaully i m getting the desired output expected from execvp()...but once results are displayed on the output screen ,program is getting hanged up
values of... (3 Replies)
Discussion started by: Crab
3 Replies
10. Shell Programming and Scripting
I have a function that returns a bunch of exit codes, say func1, and in my code I'm trying to execute that function in an if statement. This is the closest I could get.
f1call=`func1 $arg1 $arg2`
if ]; then
...
fi
When I run the script the function never gets called. What's the right way... (7 Replies)
Discussion started by: eur0dad
7 Replies