Sponsored Content
Top Forums Shell Programming and Scripting how to use cd command in shell script Post 302135409 by LAKSHMI NARAYAN on Sunday 9th of September 2007 04:46:47 AM
Old 09-09-2007
how to use cd command in shell script

i didn't get u
can u explain in detail
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to Write Shell Script based off of this shell command

I'm trying to read a bunch of log files and output the lines that contain particular strings. To accomplish this, I've been running the following from the command line: find . -name "*" | xargs grep " " | grep " " > output.txt Two grep statements are needed in case I'm looking for a... (3 Replies)
Discussion started by: Rally_Point
3 Replies

2. Shell Programming and Scripting

can anyone help with shell script command about searching word with grep command?

i want to search in the current directory all the files that contain one word for example "hello" i want to achieve it with the grep command but not with the grep * (2 Replies)
Discussion started by: aintour
2 Replies

3. Shell Programming and Scripting

help with shell script: cp command not working, but mv command works...

Hello. I would like to ask your help regarding the cp command. We are using a cp command to create a back-up copy of our file but to no avail. It's just not working. We already checked the file and directory permissions and all seems correct. We have a script (ftp.script) which calls on... (1 Reply)
Discussion started by: udelalv
1 Replies

4. Shell Programming and Scripting

Shell script running command in different shell

Hi All, Is there any way where we can run few commands with different shell in a shell script ? Let's have an example below, My first line in script reads below, #!/bin/sh However due to some limitation of "/bin/sh" shell I wanted to use "/bin/bash" while executing few... (9 Replies)
Discussion started by: gr8_usk
9 Replies

5. Shell Programming and Scripting

When i am trying to execute export command within a shell script it is saying command not found.

I am running the export command within a view to use that value inside my build script. But while executing it it is saying "export command not found" My code is as follows: -------------------------- #!/bin/sh user="test" DIR="/bldtmp/"$user VIEW="test.view1" echo "TMPDIR before export... (4 Replies)
Discussion started by: dchoudhury
4 Replies

6. Shell Programming and Scripting

In Shell Script Does Second Command Wait For First Command To Complete

Hi All, I have a question related to Shell scripting. In my shell script, I have following two commands in sequence: sed 's/^/grep "^120" /g' $ORIGCHARGEDAMTLIST|sed "s;$;| cut -f$FIELD_NO1 -d '|' | awk '{ sum+=\$1} END {printf (\"%0.2f\\\n\", sum/100)}' >$TEMPFILE mv $TEMPFILE $ORIGFILE... (3 Replies)
Discussion started by: angshuman
3 Replies

7. Post Here to Contact Site Administrators and Moderators

Unable to pass shell script parameter value to awk command in side the same script

Variable I have in my shell script diff=$1$2.diff id=$2 new=new_$diff echo "My id is $1" echo "I want to sync for user account $id" ##awk command I am using is as below cat $diff | awk -F'~' ''$2 == "$id"' {print $0}' > $new I could see value of $id is not passing to the awk... (0 Replies)
Discussion started by: Ashunayak
0 Replies

8. Shell Programming and Scripting

Unable to pass shell script variable to awk command in same shell script

I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist. diff=$1$2.diff id=$2 new=new_$diff echo "My id is $1" echo "I want to sync for user account $id" ##awk command I am using is as below cat $diff | awk... (2 Replies)
Discussion started by: Ashunayak
2 Replies

9. UNIX for Dummies Questions & Answers

Passing shell script parameter value to awk command in side the script

I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist. diff=$1$2.diff id=$2 new=new_$diff echo "My id is $1" echo "I want to sync for user account $id" ##awk command I am using is as below cat $diff |... (1 Reply)
Discussion started by: Sarita Behera
1 Replies

10. UNIX for Dummies Questions & Answers

Shell script not working but command works in command prompt

Hi everyone I have a problem with my script If I try directly this command /usr/bin/nice -n 19 mysqldump -u root --password="******" wiki_schneider -c | nice -n 19 gzip -9 > /point_de_montage/$(date '+%Y%m%d')-wiki-db.sql.gz It works But if I simply add this command in a script and... (8 Replies)
Discussion started by: picemma
8 Replies
explain_open(3) 					     Library Functions Manual						   explain_open(3)

NAME
explain_open - explain open(2) errors SYNOPSIS
#include <libexplain/open.h> const char *explain_open(const char *pathname, int flags, int mode); const char *explain_errno_open(int errnum, const char *pathname, int flags, int mode); void explain_message_open(char *message, int message_size, const char *pathname, int flags, int mode); void explain_message_errno_open(char *message, int message_size, int errnum, const char *pathname, int flags, int mode); DESCRIPTION
These functions may be used to obtains explanations for open(2) errors. explain_open(const char *pathname, int flags, int mode); const char *explain_open(const char *pathname, int flags, int mode); The explain_open function is used to obtain an explanation of an error returned by the open(2) system call. The least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail. The errno global variable will be used to obtain the error value to be decoded. This function is intended to be used in a fashion similar to the following example: int fd = open(pathname, flags, mode); if (fd < 0) { fprintf(stderr, '%s0, explain_open(pathname, flags, mode)); exit(EXIT_FAILURE); } pathname The original pathname, exactly as passed to the open(2) system call. flags The original flags, exactly as passed to the open(2) system call. mode The original mode, exactly as passed to the open(2) system call (or zero if the original call didn't need a mode argument). Returns: The message explaining the error. This message buffer is shared by all libexplain functions which do not supply a buffer in their argument list. This will be overwritten by the next call to any libexplain function which shares this buffer, including other threads. Note: This function is not thread safe, because it shares a return buffer across all threads, and many other functions in this library. explain_errno_open const char *explain_errno_open(int errnum, const char *pathname, int flags, int mode); The explain_errno_open function is used to obtain an explanation of an error returned by the open(2) system call. The least the message will contain is the value of strerror(errnum), but usually it will do much better, and indicate the underlying cause in more detail. This function is intended to be used in a fashion similar to the following example: int fd = open(pathname, flags, mode); if (fd < 0) { int err = errno; fprintf(stderr, '%s0, explain_errno_open(err, pathname, flags, mode)); exit(EXIT_FAILURE); } errnum The error value to be decoded, usually obtained from the errno global variable just before this function is called. This is neces- sary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno. pathname The original pathname, exactly as passed to the open(2) system call. flags The original flags, exactly as passed to the open(2) system call. mode The original mode, exactly as passed to the open(2) system call (or zero if the original call didn't need a mode argument). Returns: The message explaining the error. This message buffer is shared by all libexplain functions which do not supply a buffer in their argument list. This will be overwritten by the next call to any libexplain function which shares this buffer, including other threads. Note: This function is not thread safe, because it shares a return buffer across all threads, and many other functions in this library. explain_message_open void explain_message_open(char *message, int message_size, const char *pathname, int flags, int mode); The explain_message_open function is used to obtain an explanation of an error returned by the open(2) system call. The least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail. The errno global variable will be used to obtain the error value to be decoded. This function is intended to be used in a fashion similar to the following example: int fd = open(pathname, flags, mode); if (fd < 0) { char message[3000]; explain_message_open(message, sizeof(message), pathname, flags, mode); fprintf(stderr, '%s0, message); exit(EXIT_FAILURE); } message The location in which to store the returned message. Because a message return buffer has been supplied, this function is thread safe. message_size The size in bytes of the location in which to store the returned message. pathname The original pathname, exactly as passed to the open(2) system call. flags The original flags, exactly as passed to the open(2) system call. mode The original mode, exactly as passed to the open(2) system call (or zero if the original call didn't need a mode argument). explain_message_errno_open void explain_message_errno_open(char *message, int message_size, int errnum, const char *pathname, int flags, int mode); The explain_message_errno_open function is used to obtain an explanation of an error returned by the open(2) system call. The least the message will contain is the value of strerror(errnum), but usually it will do much better, and indicate the underlying cause in more detail. This function is intended to be used in a fashion similar to the following exameple: int fd = open(pathname, flags, mode); if (fd < 0) { int err = errno; char message[3000]; explain_message_errno_open(message, sizeof(message), err, pathname, flags, mode); fprintf(stderr, '%s0, message); exit(EXIT_FAILURE); } message The location in which to store the returned message. Because a message return buffer has been supplied, this function is thread safe. message_size The size in bytes of the location in which to store the returned message. errnum The error value to be decoded, usually obtained from the errno global variable just before this function is called. This is neces- sary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno. pathname The original pathname, exactly as passed to the open(2) system call. flags The original flags, exactly as passed to the open(2) system call. mode The original mode, exactly as passed to the open(2) system call (or zero if the original call didn't need a mode argument). COPYRIGHT
libexplain version 0.52 Copyright (C) 2008 Peter Miller AUTHOR
Written by Peter Miller <pmiller@opensource.org.au> explain_open(3)
All times are GMT -4. The time now is 03:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy