10-24-2010
Show us what you did so far, give more clue about your input and also give a sample of what output you expect.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How do I check if the argument passed to a script is an integer?
I am writting a script that will take to integers and want to be able to check before I go on.
I am using bourne shell.
Thanks in advance (13 Replies)
Discussion started by: elchalateco
13 Replies
2. Shell Programming and Scripting
hi
i have a function
abc
{
//from this function i am passing args to antoher function like
def a b c j k l
}
now i want to count the no of args coming to def() function and iterate over those values
is there any way to do this one
please help (2 Replies)
Discussion started by: satish@123
2 Replies
3. Shell Programming and Scripting
$ ls
monkey.txt
banana.csv
tree.txt
$ myscript monkey.txt tree.txt
All extensions ARE alike.
$ myscript *txt
All extensions ARE alike.
$ myscript monkey.txt banana.csv
All extensions are NOT alike.
$ myscript *
All extensions are NOT alike.
My brain has given up; what's the simplest... (11 Replies)
Discussion started by: cs03dmj
11 Replies
4. Shell Programming and Scripting
Hi,
I am using SYBASE database. in my script i am connecting to DB via using isql.
isql -U${S_USER} -S${S_SERV} -D${S_DB} -P${S_PWD} -b0 -w3000 -h0 -s"|" -i${MYDIR}/ABC.sql -oXYZ.txt << FINSQL
i am taking a ABC.sql file to use the queries written in it and storing the output in... (3 Replies)
Discussion started by: dazdseg
3 Replies
5. Red Hat
hi,
i have an rpm, and i am looking at the presinstall script. i can see it takes in an argument, but what i do not know is how this argument is passed to the script? is there something that calls the preinstall script? i thought the preinstall script was the first thing executed.
thanks (2 Replies)
Discussion started by: JamesByars
2 Replies
6. 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
7. Shell Programming and Scripting
Hi
I want to write a script which store all the parameters passed to the script into an array.
Once it is stored I want scan through the array and and delete those files for last month present inside the directory. The files in directory is appneded with YYYY_MM_DD.
I want to know how can I... (3 Replies)
Discussion started by: dgmm
3 Replies
8. Shell Programming and Scripting
Hi all,
I am trying to delete columns in a file using a script. The columns that need to be deleted are passed as arguments to the script.
The script should look like this
> delete_columns.sh <file_name.txt> <column_numbers_to_be_deleted>
The contents of the file_name.txt will be like ... (5 Replies)
Discussion started by: VNR
5 Replies
9. Shell Programming and Scripting
I want to make a script that check for the argument passed to it and generates an error in case any character/string argument passed to it.
I am using below code, but its not working. can anyone help.
#!/bin/bash
if ]; then
echo 'An integer argument is passed to the script hence... (3 Replies)
Discussion started by: mukulverma2408
3 Replies
10. Shell Programming and Scripting
My requirement is that I want to pass similar argument to a shell script and process it in the script. Something like below:
myScript.sh -c COMPONENT1 -c COMPONENT2 -a APPNote: -c option can be specified multiple times and -a is optional parameter
I know this can be achieved using... (2 Replies)
Discussion started by: rajdeep_paul
2 Replies
su(1) General Commands Manual su(1)
NAME
su - Substitutes user ID temporarily
SYNOPSIS
su [- | -f] [user] [shell_option] [shell_command]
OPTIONS
Prevents the user's shell initialization file from being executed by passing the -f option to the user's shell, thus making su start up
faster. The -f option is supported by the csh family of shells. Simulates a full login by executing the commands in either the and files
for csh or the file for sh and ksh and by setting the current working directory to the user's home directory. Passes the specified shell
option flag to the newly invoked user's shell for execution. The shell_option must be supported by the invoked shell. The csh, sh, ksh, and
any other interactive command shell support the commonly used -c shell option. By default (no "shell_option"), the shell is opened with the
-i (interactive) shell option. See the reference page for the shell you are using for more information on the shell options. Passes the
specified command to the newly invoked user's shell for execution. The shell_command must be supported by the invoked shell.
DESCRIPTION
The su command demands the password of the specified user, and if it is given, changes to that user and invokes the user's shell without
changing the current directory.
Except in a case where the - option is used, the user environment is unchanged except for HOME, SHELL, USER, and LOGNAME which are taken
from the password file for the user being substituted (see environ). The new user ID stays in force until the shell exits.
If no user is specified, root is assumed. Only users who belong to group number 0 (system) can issue su to become root, even with the root
password. To remind superusers of their responsibilities, the shell substitutes a # (number sign) for its usual prompt.
Shell commands may be passed to the shell that is spawned by su by including them on the command line after the su flags and arguments.
After the flags recognized by su and the user argument are processed, unrecognized command line flags (shell_options) and/or arguments
(shell_commands) are passed to the shell for execution. If the spawned shell does not support the command or the format of the command, the
command is not executed and the resulting shell behavior and error messages are determined by the shell.
Security Restrictions
The su command fails if any lock conditions exist on the target account. Specifically, if the destination account was retired, if the num-
ber of unsuccessful login attempts exceeds the maximum allowed, if the administrative lock was applied, or the password's lifetime was
exceeded, the Information System Security Officer (ISSO) must unlock the destination account before any user can log in to it or use su to
transition to it.
SECURITY NOTE
This security-sensitive command uses SIA (Security Integration Architecture) as an interface to the security mechanism(s) that perform the
actual user validation. See the matrix.conf(4) reference page for more information.
ENVIRONMENT VARIABLES
The following environment variables affect the behavior of su:
SEE ALSO
Commands: csh(1), ksh(1), sh(1)
su(1)