01-26-2009
How to store contents of a command in array of variables in shell script?
I want to store contents of command
dir in array of variables
For eg: dir contents are
command d2 demovi~ file inven java new untitled folder
d1 demovi er1 filename inven~ myfiles ubuntu desktop xmms
-----------------------------------
I should be able to get command, d2, demovi~,.............. in var1, var2, var3,....
eg. echo $var4
should give output : file
Thanks in advance
Its urgent
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
:)
Suppose,I have one table A. Table A have one column. Table A have 10 rows. I want this 10 rows store into shell script variable.
like
#!/bin/ksh
v_shell_var=Hi
here in call oracle , through loop How can I store table A's 10 rows into v_shell_var (Shell Script Array).
Regards,
Div (4 Replies)
Discussion started by: div_Neev
4 Replies
2. UNIX for Dummies Questions & Answers
im looping through an array setting three variables each time (one of the variables gives me the position in the array and is incremented each loop)
im trying to then set the variables to that position in the array without much luck. any ideas?
anArray=`$VAR1+$VAR2+"("$pos")"` (1 Reply)
Discussion started by: magnia
1 Replies
3. Shell Programming and Scripting
Hi Guys,
I have a file which has numbers in it separated by newlines as follows:
1.113
1.456
0.556
0.021
-0.541
-0.444
I am using the following code to store these in an array in bash:
FILE14=data.txt
ARRAY14=(`awk '{print}' $FILE14`) (6 Replies)
Discussion started by: npatwardhan
6 Replies
4. Shell Programming and Scripting
Hi,
I"m writing a script to store all the contents of multiple files with different file names into one single file.
I am giving in only last modified date of file in a folder. The below script gives a list of just one file based on the input date i give which is taken as string variable. I... (2 Replies)
Discussion started by: ashrocks
2 Replies
5. Shell Programming and Scripting
Hello All
My req is to store the exit status of a command in shell variable
I want to check whether the file has header or not
The header will contain the string
DATA_ACQ_CYC_CNTL_ID
So I am running the command
head -1 $i | grep DATA_ACQ_CYC_CNTL_ID
Now I have to check if... (6 Replies)
Discussion started by: Pratik4891
6 Replies
6. Shell Programming and Scripting
I want to pass an array of variables to be inserted by awk in the 2nd column of a file.
Empl No. Employee Age
1000000 22
1100000 24
1200000 26
Now, I want to pass an array having three different ages which need to replace the... (7 Replies)
Discussion started by: Nishi_Licious
7 Replies
7. Shell Programming and Scripting
I want to create an array which can store the strings from the user input in shell script .
example :-
I want to store the 5 fruits name in a single array which the user provides . (1 Reply)
Discussion started by: Pkast
1 Replies
8. Shell Programming and Scripting
I have a input file like this.
Sample.txt
30 | TXDatacenter | TXBackupDC
10 | UKDatacenter | UKBackupDC
0 | NLDatacenter | NLBackupDC
......
......
......
I need to get these values in different variables like this.
Load1=30
PriCenter1=TXDatacenter... (5 Replies)
Discussion started by: Visha
5 Replies
9. Linux
how to store the count of queries in variables inside a filein shell script
my output :
filename
-------
variable1=result from 1st query
variable2=result from 2nd query
.
.
.
. (3 Replies)
Discussion started by: sanvel
3 Replies
10. Shell Programming and Scripting
I'm trying to achieve the follwoinig with no luck.
Find the directories that are greater than 50GB in size and pick the owner of the directory as I would like to send an alert notification.
du -sh * | sort -rh
139G Dir_1
84G Dir_2
15G Dir_3
ls -l Dir_1
drwx------ 2... (3 Replies)
Discussion started by: 308002184
3 Replies
LEARN ABOUT DEBIAN
fbautostart
FBAUTOSTART(1) fbautostart Manual FBAUTOSTART(1)
NAME
fbautostart - Autostart all XDG applications
SYNOPSIS
fbautostart [options]
DESCRIPTION
fbautostart(1) is an XDG complaint startup tool. This will go through the directories set up by the spec, and start all applications that
match it's current identifier. You may change that identifier with the FBXDG_DE env var.
This tool has almost no library dependencies and was written to be smart about that sort of stuff. There is a greater then average chance
that you will find a bug, since it is a from-scratch implementation of the .desktop spec. Pleas report bugs. Please.
FILES
~/.config/autostart
This folder contains the default user XDG dot-desktop files that will be run ( unless it's overridden by an ENV variable )
/etc/xdg
This folder contains the default system XDG dot-desktop files that will be run ( unless it's overridden by an ENV variable )
OPTIONS
Sadly, there are no flags in this particular release.
ENVIRONMENT VARIABLES
XDG_CONFIG_HOME
The XDG root directory for the user's startup files, which may override the global startup files.
XDG_CONFIG_DIRS
The root XDG directory, where global XDG files are maintained.
FBXDG_DE
Development environment that we should act upon. This defaults to "FLUXBOX", since this is a fluxbox project, after all. Please note
this is case sensitive.
FBXDG_EXEC
This dictates if we should execute the application that we've been told to or not. This is particularly useful for debugging the app.
HOME
The location of one's home directory, such that ~/ will be expanded to /home/user/
EXAMPLE
fbautostart
AUTHORS
Paul Tagliamonte <paultag@ubuntu.com[1]> for fbautostart 2.718281
SEE ALSO
fluxbox(1)
AUTHOR
Paul Tagliamonte <paultag@ubuntu.com>
Author.
NOTES
1. paultag@ubuntu.com
mailto:paultag@ubuntu.com
fbautostart.txt 7th September 2011 FBAUTOSTART(1)