#!/bin/sh shell question


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting #!/bin/sh shell question
# 1  
Old 02-23-2006
Data #!/bin/sh shell question

HI,
Nice to meet u... I am a newbie. I have met a problem in the work as following:
SRCLOG[0]="/Share/log/testlog/*"
SRCLOG[1]="/Share/log/systemlog/*"
SRCLOG[2]="/Share/log/log.conf"
SRCLOG[3]="/Share/log/message"
How can I get the file or directory value from each element of this array by shell? (How to remove the "/*"?)
Expect result :
SRCLOG[0]="/Share/log/testlog"
SRCLOG[1]="/Share/log/systemlog"
SRCLOG[2]="/Share/log/log.conf"
SRCLOG[3]="/Share/log/message"
Thank u very much indeed
Best Regards!

Last edited by GCTEII; 02-23-2006 at 05:32 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Usage of #!/bin/sh vs #!/bin/bash shell scripts?

Some question about the usage of shell scripts: 1.) Are the commands of the base shell scripts a subset of bash commands? 2.) Assume I got a long, long script WITHOUT the first line. How can I find out if the script was originally designed für "sh" or "bash"? 3.) How can I check a given... (3 Replies)
Discussion started by: pstein
3 Replies

2. AIX

Redistribution bin required for AIX. j7r164redist.7.1.0.25.bin

Hi, I am planning to install a version of Informatica on my AIX box. It requires a specific java build in pap6470_27sr2-20141101_01(SR2). The current link for IBM 64-bit SDK for AIX®, JavaTM Technology Edition, Version 7 Release 1 has a more recent version in j7r164redist.7.1.0.75.bin. Is... (4 Replies)
Discussion started by: meetpraveens
4 Replies

3. Shell Programming and Scripting

shell type.. /bin/uvalid?

Hi, I gave a command echo $SHELL --> To find out the shell I'm using, which gave me the below output echo $SHELL /bin/uvalid what does it mean? Please use code tags when posting data and code samples, thank you. (1 Reply)
Discussion started by: dnam9917
1 Replies

4. OS X (Apple)

When to use /Users/m/bin instead of /usr/local/bin (& whats the diff?)?

Q1. I understand that /usr/local/bin means I can install/uninstall stuff in here and have any chance of messing up my original system files or effecting any other users. I created this directory myself. But what about the directory I didn't create, namely /Users/m/bin? How is that directory... (1 Reply)
Discussion started by: michellepace
1 Replies

5. Shell Programming and Scripting

Convert perl-statement to /bin/sh shell

Hi, I'm doing a small shellscript which is going to take each line in a "queue file" and do stuff to them. I can do the script easily, but I'd like this one to be a bit prettier. Consider the following perl statement: ... foreach my $line (@filedata) { my ($a, $b, $c) = split(/\t/,... (4 Replies)
Discussion started by: brightstorm
4 Replies

6. Shell Programming and Scripting

[Bourne shell] Asking stuff with #!bin/sh urgent!

1. Accept a “userid” as a command line argument 2. Produce the following output: User userid has a home directory of /path/directory the default shell for this user is /path/shell 3. At this level, it may be assumed that the “userid” is a unique string in the file that is being searched 4.... (17 Replies)
Discussion started by: grandios
17 Replies

7. UNIX for Dummies Questions & Answers

fuser: difference with bin/sh and bin/ksh shell script

Hi, I have a problem I don't understand with fuser. I launch a simple shell script mysleep.sh: I launch the command fuser -fu mysleep.sh but fuser doesn't return anything excepted: mysleep: Then I modify my script switching from #!/bin/sh to #!/bin/ksh I launch the command fuser -fu... (4 Replies)
Discussion started by: Peuj
4 Replies

8. Shell Programming and Scripting

Using #! /bin/sh in Shell scripts

Hi All, What does #! /bin/sh mean in a shell script? Is it mandatory to include in a shell script? I'm able to execute the shell script without it. Any help on this would be appreciated. (4 Replies)
Discussion started by: sumesh.abraham
4 Replies

9. Shell Programming and Scripting

CSH CGI-BIN question ?

Hi, 1. How to Write csh CGI-BIN script which return a web page which show the environment of the executed script ? 2. How do we read command line on csh and ksh ? Thank's (2 Replies)
Discussion started by: 7eleven
2 Replies
Login or Register to Ask a Question
CLONE(2)						      BSD System Calls Manual							  CLONE(2)

NAME
clone, __clone -- spawn new process with options LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sched.h> pid_t clone(int (*func)(void *arg), void *stack, int flags, void *arg); pid_t __clone(int (*func)(void *arg), void *stack, int flags, void *arg); DESCRIPTION
The clone system call (and associated library support code) creates a new process in a way that allows the caller to specify several options for the new process creation. Unlike fork(2) or vfork(2), in which the child process returns to the call site, clone causes the child process to begin execution at the function specified by func. The argument arg is passed to the entry point, as a means for the parent to provide context to the child. The stack pointer for the child process will be set to stack. Note that the clone interface requires that the application know the stack direc- tion for the architecture, and that the caller initialize the stack argument as appropriate for the stack direction. The flags argument specifies several options that control how the child process is created. The lower 8 bits of flags specify the signal that is to be sent to the parent when the child exits. The following flags may also be specified by bitwise-or'ing them with the signal value: CLONE_VM Share the virtual address space with the parent. The address space is shared in the same way as vfork(2). CLONE_FS Share the ``file system information'' with the parent. This include the current working directory and file creation mask. CLONE_FILES Share the file descriptor table with the parent. CLONE_SIGHAND Share the signal handler set with the parent. Note that the signal mask is never shared between the parent and the child, even if CLONE_SIGHAND is set. CLONE_VFORK Preserve the synchronization semantics of vfork(2); the parent blocks until the child exits. The clone call returns the pid of the child in the parent's context. The child is provided no return value, since it begins execution at a different address. If the child process's entry point returns, the value it returns is passed to _exit(2), and the child process exits. Note that if the child process wants to exit directly, it should use _exit(2), and not exit(3), since exit(3) will flush and close standard I/O channels, and thereby corrupt the parent process's standard I/O data structures (even with fork(2) it is wrong to call exit(3) since buffered data would then be flushed twice). Note that clone is not intended to be used for new native NetBSD applications. It is provided as a means to port software originally written for the Linux operating system to NetBSD. RETURN VALUES
Same as for fork(2). ERRORS
Same as for fork(2). SEE ALSO
chdir(2), chroot(2), fork(2), sigaction(2), sigprocmask(2), umask(2), vfork(2), wait(2) HISTORY
The clone() function call appeared in NetBSD 1.6. It is compatible with the Linux function call of the same name with respect to the described options. BUGS
The NetBSD implementation of clone() does not implement the following flags that are present in the Linux implementation: o CLONE_CHILD_CLEARTID o CLONE_CHILD_SETTID o CLONE_IO o CLONE_NEWIPC o CLONE_NEWNET o CLONE_NEWNS o CLONE_NEWPID o CLONE_NEWUTS o CLONE_PARENT o CLONE_PARENT_SETTID o CLONE_PID o CLONE_PTRACE o CLONE_SETTLS o CLONE_STOPPED o CLONE_SYSVSEM o CLONE_THREAD o CLONE_UNTRACED BSD
May 4, 2010 BSD