I am trying to set up a variable based on the name of the file.
function script_name {
if
then
job_name='MONITOR'
return job_name;
elsif
then
job_name='VERSION'
return job_name
fi
}
for i in `ls *log`
do
script_name $i
done. (4 Replies)
I am creating a script that will automatically use sftp to connect to a site and download a file, extract the tar and then delete the tar file once completed.
What I am stuck on is the error checking for this process.
Here is the code so far:
Now this works for me as is, but i need... (0 Replies)
hi
i have a file, i am reading line by line and checking a line contains a string ,
`grep "Change state" $LINE`
if
then
echo "The line contains---"
else
echo "The line does not contains---"
i need to check the return code , but i am getting an error
... (4 Replies)
I am currently wrapping up a assignment for one of my classes. I need help writing some error checking logic. The problems I am having are:
keeping track of the records I have deleted and reported it back using echo.
I have no idea how to do this.
ensuring that line numbers fall... (1 Reply)
hi friends ,
i need c code for my app,
in my app the user can create the new user for the system,
while creating the new user ,i try to include the condition
the user name is not present in password.
my exe requrment is : the user name char is not present in password,if the password... (6 Replies)
i was just wondering how would you check , beside the lock method, if an instance of another code is already running and if it is then output a message to the user saying the program is already running and exit!! the code is in BOURNE SHELLL!!!
thanks in advance!! (3 Replies)
I have a short line of code that checks very rudimentary for duplicate code:
sort myfile.cpp | uniq -c | grep -v "^.*1 " | grep -v "}"
It sorts the file, counts occurrences of each line, removes single occurrences and removes the ubiquitous closing brace. The language is C++, but is easily... (3 Replies)
#!/bin/ksh
#This script will check status of load balancer in AIX servers from hopbox
#Steps to do as folows :
#Login to server
#netstat -ani | grep <IP>
#check if the output contains either lo0 OR en0
#if the above condition matches, validation looks good
#else, send an email with impacted... (7 Replies)
Hi,
I am writing the shell script in ksh to check certain no of files exists,In my case there are 7 files exist like below
Sales1_timstamp.csv
Sales2_timstamp.csv
Sales3_timstamp.csv
Sales4_timstamp.csv
Sales5_timstamp.csv
Sales7_timstamp.csv
Sales7_timstamp.csv
Once all the files... (4 Replies)
Discussion started by: SRPR
4 Replies
LEARN ABOUT MOJAVE
mkpath_np
mkpath_np(3) BSD Library Functions Manual mkpath_np(3)NAME
mkpath_np -- Auxiliary routine for efficiently creating paths
SYNOPSIS
#include <unistd.h>
int
mkpath_np(const char * path, mode_t omode);
DESCRIPTION
This routine allows the caller to create a path, including intermediate directories. It is equivalent to calling mkdir(1) with the -p com-
mand line argument.
Intermediate directories are created with permission bits of rwxrwxrwx (0777) as modified by the current umask, plus write and search permis-
sion for the owner.
The leaf directory is created with permission bits of omode as modified by the current umask.
RETURN VALUES
A 0 return value indicates success. If an error occurs, the return value is a non-zero error code. Note that EEXIST is returned iff the
leaf directory already exists and is a directory, so under certain circumstances, this error value may not indicate a failure state.
This routine does NOT modify errno.
ERRORS
Any error code that can be returned by mkdir(2) can be returned by mkpath_np(), but mkpath_np() will return the error code rather than set-
ting errno.
[ENOTDIR] A component of the path is not a directory (in contrast to mkdir(2) which returns this based on the path prefix rather
than the path).
[EEXIST] The path already exists and is a directory.
HISTORY
This function first appeared in iOS 5.0.
SEE ALSO mkdir(1), chmod(2), mkdir(2)Mac OS X July 13, 2011 Mac OS X