12-14-2016
Quote:
Originally Posted by
Corona688
Run mkdir with an absolute path.
Of course, if you just want a version of mkdir which doesn't return error when the folder already exists, standard POSIX-compliant mkdir can do that already: mkdir -p
changing
mkdir "$1" to
/usr/bin/mkdir "$1" resolves the recursive problem !! Thank you ....
10 More Discussions You Might Find Interesting
1. 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
2. Shell Programming and Scripting
Hi ,
I have three funcions f1, f2 and f3 .
f1 calls f2 and f2 calls f3 .
I have a global variable "period" which i want to pass to f3 .
Can i pass the variable directly in the definition of f3 ?
Pls help .
sars (4 Replies)
Discussion started by: sars
4 Replies
3. UNIX for Dummies Questions & Answers
I want to write a shell script which traverses a cpp file.
Suppose there is function fncn_name6 .. which is called by fncn_name5
which in turn called by fncn_name4 and so on .. in a single cpp class.
ie
fncn_name1
{
fncn_name2
{
fncn_name3
}
{
fncn_name4
}
}
so fncn_name1 is... (2 Replies)
Discussion started by: ultimatix
2 Replies
4. Shell Programming and Scripting
Hello Experts,
I am building a shell where I need to use case structure. The structure is in a function as in the sample code below:
# Shell mySh
#!/bin/sh
doThis(){
var=$1
case "$var" in
IT)
echo "ok 1 $var"
;;
... (7 Replies)
Discussion started by: hkansal
7 Replies
5. Shell Programming and Scripting
Hello to all,
I am looking for a way to display only the names of function (calls & definition) of a C++ source code.There is already a post related to this, but the script is to find the functions using a specific variable, and the replies are not that convincing since they cannot be used for... (2 Replies)
Discussion started by: frozensmilz
2 Replies
6. Shell Programming and Scripting
I have two scripts. script1.sh looks
--------------------------------
#!/bin/bash
display()
{
echo "Welcome to Unix"
}
display
-----------------------------
Script2.sh
#!/bin/bash
sh script1.sh //simply calling script1.sh
------------------------------ (1 Reply)
Discussion started by: mvictorvijayan
1 Replies
7. UNIX for Advanced & Expert Users
Hi Guys,
I am trying to pass arguments to the script i am wrinting.
When no argument is passed or wrong argument is passed, the script needs to output the way it needs to be called and exit.
Currently, when no arguments is passed, it is not getting exited but goes on assuming those... (3 Replies)
Discussion started by: mac4rfree
3 Replies
8. UNIX for Dummies Questions & Answers
We have a program source C and is required to indicate how many times each function is called from the C program. also print the line number where there is a call.
I've tried something like this:
#!/bin/sh
for i in $*;do
if !
then
echo $i is not a C file.
else echo $i... (0 Replies)
Discussion started by: oana06
0 Replies
9. UNIX for Beginners Questions & Answers
Hi All,
I want to write a bash script in which a function needs to be called based on its first character in a supplied string. eg function "j" should be called when "jab" or "jgh" or "j" .... etc is hit. I have used complete -F in below script, however here function is invoked... (1 Reply)
Discussion started by: temp.sha
1 Replies
10. Shell Programming and Scripting
Hello,
I have this awk code in a bash script to perform a find and replace task. This finds one unique line in a file and substitutes the found line with a replacement.
#! /bin/bash
# value determined elsewhere
total_outputs_p1=100
# file being modified... (5 Replies)
Discussion started by: LMHmedchem
5 Replies