9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have the below script which creates a directory or simply terminates without throwing error (exit 1) incase the directory exists.
bash-4.1$ vi mdir.sh
#!/bin/bash -e
shopt -s expand_aliases
alias mkdir=mkdir_s
mkdir_s(){
if ]; then
echo " directory EXISTS "
return
else
echo "... (3 Replies)
Discussion started by: mohtashims
3 Replies
2. HP-UX
:wall:What is this shell called ?
"/sbin/sh"
When I run "echo $SHELL" command on my HP-UX,I get above output.
In Linux It was "/bin/bash". Which is bash shell. (5 Replies)
Discussion started by: manalisharmabe
5 Replies
3. UNIX for Dummies Questions & Answers
Can I create a file called '-a' in unix.Or can i open it with vi ?
vi \-a will give u an error that -a is invalid option for vi. (2 Replies)
Discussion started by: Swayam
2 Replies
4. UNIX for Dummies Questions & Answers
hi ..
This is sanjeev , new at the world of unix , i want to know why unix/linux is called as secure ? as i am new , please suggest me what os i should use ? i am having laptop of 256 ram .
thanks in advance
regards
sanjeev (5 Replies)
Discussion started by: sanjeev1
5 Replies
5. Shell Programming and Scripting
Is there any way to remove a file named "-r" using "rm", because "rm" assumes that file is one of it's options if I type "rm -r" and then throws an error message?
I also tried "rm -r -r" and that didn't work either. (3 Replies)
Discussion started by: dkieran
3 Replies
6. UNIX for Dummies Questions & Answers
OK, I had some odd characters in my mkdir command which resulted in the following directory getting created:
drwxr-xr-x 2 fred fredgroup 512 Apr 12 16:52 /
Any ideas how I get rid of it safely?
Interestingly that's a straight cut'n'paste and there appear to be some odd... (4 Replies)
Discussion started by: pondlife
4 Replies
7. Shell Programming and Scripting
Hello expert,
What I want is to determine whether the script is called from CRON or it is executed interactively?
I tried the following but no luck:
#!/bin/ksh
cronID=`pgrep -x cron`
GPID=`ps -ef -o ppid,pid | grep " $PPID$" | awk '{print $1}'`
if ; then
echo I am being run... (15 Replies)
Discussion started by: wes_brooks
15 Replies
8. Shell Programming and Scripting
My shell script is executing i am having no syntax errors or other errors. When i am testing the shell script i am having a problem that the procedure Prompt, Environment,List are not found.
I defined all these procedures in the shell script.
Environment()
{
FULL=N export FULL
LOGON=cat... (2 Replies)
Discussion started by: dreams5617
2 Replies
9. Programming
How to get exit value of an executable that gets called from function?
I have an executable called “myexec” which returns 0 on success and different values for different fail scenarios.
I need to call this (myexec) executable from “myprog()” function of other executable and get the exit value... (1 Reply)
Discussion started by: sureshreddi_ps
1 Replies