10 More Discussions You Might Find Interesting
1. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
create a shell script, chExt.sh that takes one or more parameters, where the first is a desired extension and the remainder are names of files to be renamed. For each file in the command line, this script should rename the file, as... (6 Replies)
Discussion started by: kcoll025
6 Replies
2. Shell Programming and Scripting
Hi,
i have a file.txt with data
Bangalore
Chennai
Hyd
filename of the script is: new.sh
result=`cat file.txt | grep $1`
if
then
echo pass
else
echo fail
fi
i am executing the file in the cmd line as "sh new.sh Bangalore"
o/p is pass
if i give "sh new.sh delhi"
o/p is... (6 Replies)
Discussion started by: harsha85
6 Replies
3. Shell Programming and Scripting
I have an for loop that reads the following file
cat param.cfg
val1:env1:opt1
val2:env2:opt2
val3:env3:opt3
val4:env4:opt4
.
.
The for loop extracts the each line of the file so that at any one point, the value of i is
val1:env1:opt1 etc...
I would like to extract each... (19 Replies)
Discussion started by: goddevil
19 Replies
4. Shell Programming and Scripting
I am running a csh script called tdarwin as
/nethome/chrisd/GStat/slinks/scripts/tdarwin.csh -frestore=npt02-z30-sr65-rgdt0p75-dc0p01-16x12drw.back -ftag=run2 -nxz=16x12 -npop=1920 -varp=0.12345
I want to write the command used to run the script to a file.
However calling $argv will... (2 Replies)
Discussion started by: kristinu
2 Replies
5. UNIX for Dummies Questions & Answers
I need to pass arguments to a shell script.My batch is calling some java program.
#################
x=$1
y=$2
java -classpath program
###################
if first parameter and second parameter is null then
java -classpath program
if first parameter is not null and second parameter is... (3 Replies)
Discussion started by: mnjx
3 Replies
6. Shell Programming and Scripting
Hi
I have a script to which I pass multiple arguments, for example lets say the script name is "abc". I run the script like
./abc def /file <directory location>
In the above "def" is the first argument and "/file" is the second argument. I expect <directory location> that is passed after... (4 Replies)
Discussion started by: zmfcat1
4 Replies
7. Shell Programming and Scripting
Hi,
I have a script which adds the user credentials to an ldap server. Im passing the variables as below..
/path/my_script $uname $pwd $environ ${deposit}
If i enter some special characters like ';' in $pwd, script returns an error which is set to display if the user enters... (5 Replies)
Discussion started by: Tuxidow
5 Replies
8. Shell Programming and Scripting
Hi,
How do I pass the password from a csh script when I su to a different user ? ( Root is not running this script )
Thanks (1 Reply)
Discussion started by: ayeger
1 Replies
9. Shell Programming and Scripting
I've written a script (bgrep) for a more advanced grep command (& attached a cut down version below). I'm trying allow all grep options to be used, or in any combination.
The script works fine if I type say
bgrep -i -files product
it will return a non-case sensitive list of matches for... (3 Replies)
Discussion started by: Kevin Pryke
3 Replies
10. UNIX for Dummies Questions & Answers
I'm trying to pass a filename, or all the files in the current directory to the ls command with a script. Unsuccessful so far, here are a few of my attempts:
#!/bin/ksh
read fname
#if (( $# > 0 )); then
$fname | ls -l
#fi
this produces a long listing of all the files in my current... (4 Replies)
Discussion started by: jpprial
4 Replies
suspend(1) User Commands suspend(1)
NAME
suspend - shell built-in function to halt the current shell
SYNOPSIS
sh
suspend
csh
suspend
ksh
suspend
DESCRIPTION
sh
Stops the execution of the current shell (but not if it is the login shell).
csh
Stop the shell in its tracks, much as if it had been sent a stop signal with ^Z. This is most often used to stop shells started by su.
ksh
Stops the execution of the current shell (but not if it is the login shell).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
csh(1), kill(1), ksh(1), sh(1), su(1M), attributes(5)
SunOS 5.10 15 Apr 1994 suspend(1)