Sponsored Content
Top Forums Shell Programming and Scripting To check for a number inside the file in UNIX Post 302849919 by MadeInGermany on Tuesday 3rd of September 2013 03:27:03 PM
Old 09-03-2013
IFS="=" temporarily sets the environment variable IFS (input field separator) to =,
the read command reads left from the IFS to the variable junk, and right from it to the variable cnt. The "standard input" is set to the file count, i.e. it reads from the file.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to check for a condition inside a file

Hi I am writing a script file which sends the log files along with their size in a folder named log to a file called temp.log using the following cmd: ls -st 190_GSTV_HUX_003QISCGSK026** >> /home/user/temp.log the temp.log looks like this: 16 190_GSTV_HUX_003QISCGSK026_message070321.log ... (11 Replies)
Discussion started by: kiran1112
11 Replies

2. UNIX for Advanced & Expert Users

Check EOF char in Unix. OR To check file has been received completely from a remote system

Advance Thanks. (1) I would like to know any unix/Linux command to check EOF char in a file. (2) Or Any way I can check a file has been reached completely at machine B from machine A. Note that machine A ftp/scp the file to machine B at unknown time. (5 Replies)
Discussion started by: alexalex1
5 Replies

3. Shell Programming and Scripting

check number or character of a file

Hi, Please see the below information. 1. Read files one by one and run the script. 2. Check if the filename is CHARTER OR NUMBER 3. Run the case statement. I have files in the folder. i will get 300 files in a single day. Abc_111111111111.csv 101010_kkk_bbbb.csv... (6 Replies)
Discussion started by: onesuri
6 Replies

4. Shell Programming and Scripting

KSH SHELL: problem calculation number of lines inside compressed file

Hi Gurus, I am working with a korn shell script to simplify some operations of calculation number of lines inside compressed file. The called function (inside a cycle) is the following: ######################################### # F.ne: CheckCount #########################################... (3 Replies)
Discussion started by: GERMANICO
3 Replies

5. Shell Programming and Scripting

How to insert a sequence number column inside a pipe delimited csv file using shell scripting?

Hi All, I need a shell script which could insert a sequence number column inside a dat file(pipe delimited). I have the dat file similar to the one as shown below.. |A|B|C||D|E |F|G|H||I|J |K|L|M||N|O |P|Q|R||S|T As shown above, the column 4 is currently blank and i need to insert sequence... (5 Replies)
Discussion started by: nithins007
5 Replies

6. Shell Programming and Scripting

unzip a file then further check contents inside it

Dear all I need to unzip a file then further it has many folders to perform tak inside each folder. What Task I need to perform I'm able to do it but once I unzip a folder then I'm not able to do cd folder/ into it. I have written following code for it for i in $( ls | grep Run_20111016 ) do... (2 Replies)
Discussion started by: Bhalinder
2 Replies

7. Shell Programming and Scripting

Linux Shell Script to check for string inside a file?

This is what I have so far grep -lir "some text" * I need to check all files on the system for this text, if the text is found I need to change the file permissions so only ROOT has read and write access. How can this be done? (3 Replies)
Discussion started by: mapleleafs89
3 Replies

8. Shell Programming and Scripting

find biggest number inside file

Hi, I wanna find the biggest number inside of a file this is kind of example of file: 9 11 55 then i just wanna print out the biggest number i had try sed filenale | sort -k1,1n | paste -s -d',' - but i had no success ... (7 Replies)
Discussion started by: prpkrk
7 Replies

9. Shell Programming and Scripting

How to check number of group of file.?

Hi Gurus, I need check existing number of file based on the list in file list. for example: in my file list. I have below: abc, file1.txt abc, file2.txt abc, file3.txt abc, file4.txt cde, filea1.txt cde, filea2.txt cde, filea3.txt ... in my current file direcotry, I have file:... (0 Replies)
Discussion started by: ken6503
0 Replies

10. Shell Programming and Scripting

Check if files inside a text file are found under a directory

Hi all, Please somebody help me with this: I want to check if the files listed in a text file, are found under a directory or not. For example: the file is list_of_files.txt, which contains inside this rows: # cat list_of_files logs errors paths debug # I want to check if these... (3 Replies)
Discussion started by: arrals_vl
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 04:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy