Sponsored Content
Full Discussion: Help with Shell script code
Top Forums Shell Programming and Scripting Help with Shell script code Post 302806075 by Geekie on Sunday 12th of May 2013 11:01:55 AM
Old 05-12-2013
Help with Shell script code

Hello all,

I am in a middle of an assignment and i would appreciate any help.
How can i write a bash shell script code that checks if all elements in an array are the same numbers. I mean -->array = ( 0,0,0,0,0 )

( e.g., if [ #all array elements equal zero ]
then return "OK'
fi )

Thank you in advance,
 

10 More Discussions You Might Find Interesting

1. Solaris

Pl explain the shell script code

if then ROLLBACK=1 ; elif then echo "Nothing to install!" ; echo "Exiting." ; exit 0; Plz explaing what is the ${1:-0} in if loop?:) (3 Replies)
Discussion started by: ysrikanth
3 Replies

2. Shell Programming and Scripting

code formatter for shell script

hello, do anybody know a program to format a shell script code ? i tried "editrocket.com" but this product doesn't format a shell script code. i searched for programs but can't find a shell script code formatter. i have to change a shell script and the style of code is ..... regards (5 Replies)
Discussion started by: bora99
5 Replies

3. Shell Programming and Scripting

Insert C code in shell script

Hi, Anybody know on how to insert C code in shell script. I am writing BLOB data to a database table in C but I don't know on how to insert the C code in shell script. Thanks in advance. (1 Reply)
Discussion started by: badbunny9316
1 Replies

4. Shell Programming and Scripting

Explain this shell script code.

Hi i am new to shell script can any one please explain me the code below which is written for execution of python scripts which are located in same folder. please explain the code line by line ls *.py > xx while do read myline || break python $myline done<xx Thanks Mukthyar.... (1 Reply)
Discussion started by: mukthar1255
1 Replies

5. Shell Programming and Scripting

Code java in script shell

Hello; Is it possible to insert Java code in a shell script, if so how please? Thank you (0 Replies)
Discussion started by: chercheur857
0 Replies

6. Programming

Script shell in java code

Hello, Please i want to insert this code in a java program because i need to call a java function inside the while: Please how can i do? thank you so much (9 Replies)
Discussion started by: chercheur857
9 Replies

7. UNIX for Dummies Questions & Answers

Script Shell in java code

Hello, I try to run a script shell from a java program: but it runs only if i do :chmod 777 myShellScript in the terminal Please how can i insert chmod 777 in my java code without going through the terminal? Thank you (1 Reply)
Discussion started by: chercheur857
1 Replies

8. Shell Programming and Scripting

How to capture the exit code of a shell script in a perl script.?

hi, i want to pop up an alert box using perl script. my requirement is. i am using a html page which calls a perl script. this perl script calls a shell script.. after the shell script ends its execution, i am using exit 0 to terminate the shell script successfully and exit 1 to terminate the... (3 Replies)
Discussion started by: Little
3 Replies

9. Shell Programming and Scripting

Colour code in shell script

Hello, I am trying to colour code a single word in whole line. Can you please help. I am able to colour code the whole line but not able to do only for single word Query) I want to echo below line and colur code red to word FAILED only. This server is FAILED in check. (2 Replies)
Discussion started by: saurabh84g
2 Replies

10. Shell Programming and Scripting

Shell script code not really understandable for me

I have a script: DAYS=10 print_usage() { echo "\n" echo "Usage: $PROG dir1 " echo " This program will delete all file/directories that are beyond " echo " 'x days' old." echo " -days - This flag allows you to define x... (3 Replies)
Discussion started by: digioleg54
3 Replies
NPM-RUN-SCRIPT(1)                                                                                                                NPM-RUN-SCRIPT(1)

NAME
npm-run-script - Run arbitrary package scripts SYNOPSIS
npm run-script <command> [--silent] [-- <args>...] alias: npm run DESCRIPTION
This runs an arbitrary command from a package's "scripts" object. If no "command" is provided, it will list the available scripts. run[-script] is used by the test, start, restart, and stop commands, but can be called directly, as well. When the scripts in the package are printed out, they're separated into lifecycle (test, start, restart) and directly-run scripts. As of ` https://blog.npmjs.org/post/98131109725/npm-2-0-0, you can use custom arguments when executing scripts. The special option -- is used by getopt https://goo.gl/KxMmtG to delimit the end of the options. npm will pass all the arguments after the -- directly to your script: npm run test -- --grep="pattern" The arguments will only be passed to the script specified after npm run and not to any pre or post script. The env script is a special built-in command that can be used to list environment variables that will be available to the script at run- time. If an "env" command is defined in your package, it will take precedence over the built-in. In addition to the shell's pre-existing PATH, npm run adds node_modules/.bin to the PATH provided to scripts. Any binaries provided by locally-installed dependencies can be used without the node_modules/.bin prefix. For example, if there is a devDependency on tap in your package, you should write: "scripts": {"test": "tap test/*.js"} instead of "scripts": {"test": "node_modules/.bin/tap test/*.js"} to run your tests. The actual shell your script is run within is platform dependent. By default, on Unix-like systems it is the /bin/sh command, on Windows it is the cmd.exe. The actual shell referred to by /bin/sh also depends on the system. As of ` https://github.com/npm/npm/releases/tag/v5.1.0 you can customize the shell with the script-shell configuration. Scripts are run from the root of the module, regardless of what your current working directory is when you call npm run. If you want your script to use different behavior based on what subdirectory you're in, you can use the INIT_CWD environment variable, which holds the full path you were in when you ran npm run. npm run sets the NODE environment variable to the node executable with which npm is executed. Also, if the --scripts-prepend-node-path is passed, the directory within which node resides is added to the PATH. If --scripts-prepend-node-path=auto is passed (which has been the default in npm v3), this is only performed when that node executable is not found in the PATH. If you try to run a script without having a node_modules directory and it fails, you will be given a warning to run npm install, just in case you've forgotten. You can use the --silent flag to prevent showing npm ERR! output on error. You can use the --if-present flag to avoid exiting with a non-zero exit code when the script is undefined. This lets you run potentially undefined scripts without breaking the execution chain. SEE ALSO
o npm help 7 scripts o npm help test o npm help start o npm help restart o npm help stop o npm help 7 config January 2019 NPM-RUN-SCRIPT(1)
All times are GMT -4. The time now is 10:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy