08-14-2008
Quote:
Thanks for the responses, chaps - very helpful. Can anyone tell me if non-bash scripts would be cause not to operate if I switched to using a bash shell?
The current shell that you log into doesn't really matter as long as you set the first line in your script to the appropriate shell designated in the first line of your script #!/usr/bin/xxx where xxx is csh, ksh, etc. So you can log into the system using the bash shell and run a ksh shell script by calling the ksh shell in your script.
BTW, the Advanced Bash Scripting Guide mentioned earlier is an excellent resource for learning shell scripting.
Hope that helps...
--Robert
Last edited by rkruck; 08-14-2008 at 04:47 PM..
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello there peeps:
There is a little piece of bash shell scripting problem i have, which i was hoping you could help me with.
#!/bin/bash
stored_word()
{
case $(( $$ % 8 )) in
0 ) echo "energy";;
1 ) echo "touch";;
2 ) echo "climbing";;
3 ) echo... (3 Replies)
Discussion started by: keyvan
3 Replies
2. Shell Programming and Scripting
Hi,
can anyone help me with my scrip please. I wanted do following tasks:
1. List all the directory
2. A STDIN to ask user to enter a directory name from listed directories
3. command to check if the directory exists( or a command to validate if the user entered a valid directory name)... (3 Replies)
Discussion started by: eminjan
3 Replies
3. Shell Programming and Scripting
Hi,
can anyone help me with my scrip please. I wanted do following tasks:
1. List all the directory
2. A STDIN to ask user to enter a directory name from listed directories
3. command to check if the directory exists( or a command to validate if the user entered a valid directory name)
... (2 Replies)
Discussion started by: eminjan
2 Replies
4. Shell Programming and Scripting
have this code but when i run it i get this error
./pulse: line 2: and here is the code
#!/bin/bash
if ;
then
pulseaudio -k;
fi
what am i doing wrong
thanks
Adam (5 Replies)
Discussion started by: ab52
5 Replies
5. Shell Programming and Scripting
Hello everyone!!!! I am new to this forum ...I have a problem. And I thought that you are expert :) so you can help me with that... I have a text file with maaany lines. Every line begins with something like that:
<http aksjfskcuhrf kushkfsnus> <http sxnfrksehfsd gsdg r> I don't know if every... (16 Replies)
Discussion started by: mary_elen
16 Replies
6. Shell Programming and Scripting
Try to imagine a flag:
nnnnx
nnnxx
nnxxx
nxxxx
now imagine how it will output:
4 times the "n"and 1 times "x"
3 times "n"and" 2 times" x "
.. etc. ..
rhombus is the same only instead of "n" is there
gap "and " x "is a few times to form the correct shape
Can you help... (3 Replies)
Discussion started by: krcek12
3 Replies
7. Shell Programming and Scripting
Hi Guys i have a <script?> that spits out the location of each printer using snpget
here is the code
for i in `sed -n '/Start Printer/,/End Printer/p' /hosts/blah/etc/dhcp/hosts.conf | awk '!/^#/ {print $2}' | egrep -v \... (2 Replies)
Discussion started by: ab52
2 Replies
8. Shell Programming and Scripting
same script:
1- i am using grep to find a string called: tinker panic 0 in a file /etc/ntp.conf
if the string is not there, i want to add the strings in /etc/ntp.conf file in the first line of the file. if not do nothing or exit.
2- also i want to add # in front of the following lines in... (0 Replies)
Discussion started by: lamoul
0 Replies
9. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Try running 'phone4 xyz' and see what happens.
Modify your program so that if no matching name is found, an... (1 Reply)
Discussion started by: OmgHaxor
1 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)