The variable should have the last value which was assigned to it in loop.
Here is an example for it.
We have a script named loop_example.ksh in which variable a have many values but if you will print it's value outside from loop it will show the last one as Sunday in the above example.
Thanks,
R. Singh
ya obviously, it will have the latest value since u r overwriting the previous value of $a inside the for loop.
my question is
shell_script_B.sh
Output
check the output. Inside the Loop it prints the new value and outside the value it prints original file. what is the solution for this??
I am a newbie to awk and c programming, however am not a unix newbie. However, I do need help with a kshell script I am writing. It is almost complete, the last step is killing me. Any help would be greatly appreciated. What I am trying to do is cat a text file that has usernames. Then, using... (2 Replies)
Hi,
I have a text file with data in that I wish to extract, assign to a variable and process through a loop.
Kind of the process that I am after:
1: Grep the text file for the values.
Currently using:
cat /root/test.txt | grep TESTING= | awk -F"=" '{ a = $2 } {print a}' | sort -u
... (0 Replies)
Hi all
I run my program prog.c in the following way :
$ ./prog 1 > output.txt where 1 is a user defined initial value used by the program.
But now I want to run it for many a thousand initial values, 1-1000, and store all the outputs in different files.
Like
$ ./prog 1... (1 Reply)
Hello
I am having issues with a script I'm working on developing on a Solaris machine.
The script is intended to find out how many times a particular user (by given userid) has logged into the local system for more than one hour today.
Here is my while loop:
last $user | grep -v 'sshd'... (7 Replies)
Hello Everyone,
I'm still trying to grasp many concepts in .ksh scripting, one of them being variables inside loops. My problem is the following:
* I'm trying to set a variable inside a while read loop to reuse it outside of said loop. My lines are the following :... (13 Replies)
Hello,
I'm having trouble with formatting some text via the terminal. I can get it perfectly formatted, but when I try and copy paste the text from the output file it loses it's formatting. Very frustrating!
Basically I have 7 files (data data2 data3 data4 data5 data6 data7) containing a... (13 Replies)
Simple enough problem I think, I just can't seem to get it right.
The below doesn't work as intended, it's just a function defined in a much larger script:
CheckValues() {
for field in \
Group_ID \
Group_Title \
Rule_ID \
Rule_Severity \
... (2 Replies)
I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist.
diff=$1$2.diff
id=$2 new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk... (2 Replies)
I want to create a shell script to add a user and modify its comment field mentioned in a file.
1.
File value:-
username comment field value
xyz123 xyztesting
abc123 abctesting
def123 deftesting
2. i am using below loop to create user... (2 Replies)
I have if loop with multiple variable value check in if loop. How can i print only if loop satisfied variable and its value in shell script ? I dont want to check each variable in if loop. That makes my script larger.
if ]
then
echo "Only satisfied variable with value"
... (3 Replies)
Discussion started by: prince1987
3 Replies
LEARN ABOUT OSX
info
INFO(1) User Commands INFO(1)NAME
info - read Info documents
SYNOPSIS
info [OPTION]... [MENU-ITEM...]
DESCRIPTION
Read documentation in Info format.
OPTIONS --apropos=STRING
look up STRING in all indices of all manuals.
-d, --directory=DIR
add DIR to INFOPATH.
--dribble=FILENAME
remember user keystrokes in FILENAME.
-f, --file=FILENAME
specify Info file to visit.
-h, --help
display this help and exit.
--index-search=STRING
go to node pointed by index entry STRING.
-n, --node=NODENAME
specify nodes in first visited Info file.
-o, --output=FILENAME
output selected nodes to FILENAME.
-R, --raw-escapes
output "raw" ANSI escapes (default).
--no-raw-escapes
output escapes as literal text.
--restore=FILENAME
read initial keystrokes from FILENAME.
-O, --show-options, --usage
go to command-line options node.
--subnodes
recursively output menu items.
-w, --where, --location
print physical location of Info file.
--vi-keys
use vi-like and less-like key bindings.
--version
display version information and exit.
The first non-option argument, if present, is the menu entry to start from; it is searched for in all `dir' files along INFOPATH. If it is
not present, info merges all `dir' files and shows the result. Any remaining arguments are treated as the names of menu items relative to
the initial node visited.
EXAMPLES
info show top-level dir menu
info emacs
start at emacs node from top-level dir
info emacs buffers
start at buffers node within emacs manual
info --show-options emacs
start at node with emacs' command line options
info -f ./foo.info
show file ./foo.info, not searching dir
REPORTING BUGS
Email bug reports to bug-texinfo@gnu.org, general questions and discussion to help-texinfo@gnu.org. Texinfo home page:
http://www.gnu.org/software/texinfo/
COPYRIGHT
Copyright (C) 2004 Free Software Foundation, Inc. There is NO warranty. You may redistribute this software under the terms of the GNU
General Public License. For more information about these matters, see the files named COPYING.
info 4.8 December 2004 INFO(1)