Sponsored Content
Full Discussion: help
Operating Systems Linux help Post 93055 by majoy on Thursday 15th of December 2005 06:46:45 AM
Old 12-15-2005
Data help

ey.. i just started learning shell scripting in Mandrake linux... I have a program that will have to accept arguments and do validations if the arguments entered are containing characters other than numeric characters... I was able to detect alphabetic characters and symbols like , + - . etc.... and error messages are displayed. But when arguments containing symbols like * ) [ & ( and other characters which have special meanings, my script is not able to trap them and treat as ordinary strings that are part of my arguments...
to explain more clearly.. here's an example..

# ./sample.sh a677 7 678
--->>> here, a message indicating that the first argument contains a character is displayed. This one works correctly.

# ./sample.sh 344 56& 557
---->>> here's the prob... this time,,, it stops when it reaches the symbol & and displays a message from bash... If I use single ( or ), an error message from bash also displays.

Can anyone help me with this?
 
SETSID(1)                                                          User Commands                                                         SETSID(1)

NAME
setsid - run a program in a new session SYNOPSIS
setsid [options] program [arguments] DESCRIPTION
setsid runs a program in a new session. The command calls fork(2) if already a process group leader. Otherwise, it executes a program in the current process. OPTIONS
-c, --ctty Set the controlling terminal to the current one. -w, --wait Wait for the execution of the program to end, and return the exit value of this program as the return value of setsid. -V, --version Display version information and exit. -h, --help Display help text and exit. SEE ALSO
setsid(2) AUTHOR
Rick Sladkey <jrs@world.std.com> AVAILABILITY
The setsid command is part of the util-linux package and is available from https://www.kernel.org/pub/linux/utils/util-linux/. util-linux July 2014 SETSID(1)
All times are GMT -4. The time now is 10:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy