I am executing commands as follows in Bourne shell script. Filenames/directory names for the deletion/copying are unknown:
rm *
rmdir <directory>
cp -p * <directory>
Sometimes when no file or directory exists, error is encountered. This has no impact or whatever issue to my script but it's ugly to show to the users.
I want to prevent the error message from being displayed. Is there a way for me to prevent it?
Just redirect the output to /dev/null directory. If you get any error it will be redirected to this directory.
Hi guys !!
well i'm still new in learning UNIX , and actually i'm still studying it by myself ..
anyway, some people told me the Bourne-again shell is a good version of UNIX to work on , and i tried to download yesterday but i didn't know how to start it ...... the ReadMe file associated with... (3 Replies)
I do not claim to be an expert, but I have done things with scripts that whole teams of folks have said can not be done. Of course they should have said we do not have the intestinal fortitude to git-r-done.
I have been using UNIX actually HPUX since 1992. Unfortunately my old computer died and... (7 Replies)
Hi All
I have writing a Korn Shell script to execute it on many of our servers. But some servers don't have Korn Shell installed, they use Borne Shell.
Some operations like calculation don't work :
cat ${file1} | tail -$((${num1}-${num2})) > ${file2}
Is it possible to activate Korn Shell... (3 Replies)
Hi Guys,
Error report is still displaying on the console after executing the below command. Is there any error in the syntax?
check_event=$(cat /sbt/driver/RegressionTests/ResultsArchive/${environment}/$backupPath/TestEvents.txt | g
rep "Test Cases FAIL" | cut -c 18-) 2> log2 (4 Replies)
hi,
I am trying to assign a value through 'read' and all works well until I have a space in the in putted value, for the life of me I cant figure out how to escape this. :wall:
Any ideas?
#!/bin/sh
ask_question() {
question_text="${1}";
question_answer="";
... (2 Replies)
Exercise Five
Write a Bourne shell script which:
• Professionalism: plan for this from the start.
• Has one command line argument.
• If the command line argument is a directory then the script should output the number of
files in the directory.
• If the command line argument is an ordinary... (2 Replies)
Hi,
Get the following error when running a shell script with following statement.
Syntax error
at line 150 : `(' is not expected
150: declare -a VPO_SEV=(Normal Warning Minor Major Critical)
it runs fine using bash, so I guess the script should be using bash but is there a... (1 Reply)
Could some one tell me the difference btw Bourne shell and the Kshell? Which is more flexible and reliable in terms of portability and efficiency. When i type the following command ..
$ echo $SHELL
yields me
/bin/sh
Does this tells me that I am in Bourne shell. If yes, how can i get... (6 Replies)
How can we share a script without actually sharing the code?
I have 4 scripts in my system.
The end user has to execute the first file and based on the inputs (I am reading 1, 2 , 3 as options) my shell script will execute respective script files.
Now I dont want to share all the 4 script... (3 Replies)