Adding a while loop to my script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Adding a while loop to my script
# 8  
Old 12-20-2011
By PATH I mean the PATH variable, though the full path could also work.

Have you tried either of these?

It could also be that, without a proper login, it just can't access your X11 server. That may be required and would make sense; how is it supposed to work when your GUI isn't logged in, for instance?
# 9  
Old 12-20-2011
Quote:
Originally Posted by Corona688
By PATH I mean the PATH variable, though the full path could also work.

Have you tried either of these?

It could also be that, without a proper login, it just can't access your X11 server. That may be required and would make sense; how is it supposed to work when your GUI isn't logged in, for instance?
No I havent tried it yet.
Is it even posssible to start the X11 server via CLI? If needed I could always do a
Code:
su - $user -c "/path/to/script/script.sh

# 10  
Old 12-20-2011
Quote:
Originally Posted by binary-ninja
No I havent tried it yet.
Is it even posssible to start the X11 server via CLI? If needed I could always do a
Code:
su - $user -c "/path/to/script/script.sh

I'm not convinced launching a process which uses X even makes sense until you've already logged into X. It ought to be launched by a process created by X, as well. Perhaps you could put /path/to/script.sh & in your ~/.xinitrc
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help on Adding one counter loop at the end of each line in a file

Hello All, I have file a.txt I want to add a counter loop at the end of each line in a file ill explain: i have a site h**p://test.test=Elite#1 i want to add a a counter to the number at the end of the file, that it will be like this urlLink//test.test=Elite#1 urlLink//test.test=Elite#2... (3 Replies)
Discussion started by: nexsus
3 Replies

2. Shell Programming and Scripting

adding one more column in a loop

data1 1 0.01 3 5 1 0.6 2 1 data2 2 0.02 3 5 2 0.3 2 1 data3 3 0.01 3 5 3 0.01 2 1 output 1 0.01 data1 2 0.02 data2 3 0.01 data3 3 0.01 data3 I want to print 1st, 2nd column and the filename when second column is less than 5. (3 Replies)
Discussion started by: johnkim0806
3 Replies

3. Shell Programming and Scripting

Bash: adding commas in for loop

Dear Experts I think this is possibly the easiest thing. but I am not able to solve: I need comma to be added to end of each line echo'd. But does not want it to be added to last line. I have a script which does some data analysis and creates a command as in below code snippet for... (4 Replies)
Discussion started by: chakrapani
4 Replies

4. Shell Programming and Scripting

Help needed: Adding columns in csv file in loop

Hi Everyone: My shell script creates multiple csv files (~30) in for loop. I want to compile (or merge) 3rd column from each (all) of these files to another file (in loop). Please help. Thanks. (3 Replies)
Discussion started by: smap007
3 Replies

5. Shell Programming and Scripting

adding counter to a variable while moving in a loop

The scenario is like this : I need to read records from a file one by one and increment counter1, if a certain field matches with a number say "40"..the script should increment the counter2 and also extract a corresponding field from the same line and adding them one by one and redirecting the the... (5 Replies)
Discussion started by: mady135
5 Replies

6. Shell Programming and Scripting

Adding string variable dynamically in for loop

Hi, I need to generate the text name dynamically in for loop, ex, VAR_COPY_FILE1= file path 1 VAR_COPY_FILE2= file path 2 VAR_COPY_FILE3= file path 3 for i in 1 2 3 do if then "do some process here" fi done (3 Replies)
Discussion started by: msubash26
3 Replies

7. Shell Programming and Scripting

doing a for loop adding up the results

Hi there If I run a 'swap -l' on my solaris box, i get swapfile dev swaplo blocks free /dev/dsk/c1t0d0s1 54,65 8 67119560 65655144 /dev/dsk/c1t0d0s2 54,65 8 33119522 32655122 I wanted to run a for loop adding up the totals of each column 4 , excluding the... (2 Replies)
Discussion started by: hcclnoodles
2 Replies

8. Shell Programming and Scripting

Adding a Fileinput loop to exsiting script.

:confused: I'm very confused on what I need to do. I've looked at if, while, but I can't seem to visualize where in my current script to put the commands. I'm looking to read a directory /ERD/iface/data/ocom/citi/idd because there will be multible files, but I need to process them one at a time.... (2 Replies)
Discussion started by: netmad0
2 Replies

9. Shell Programming and Scripting

adding values with a loop

Hi there, I am checking disk spaced used on a box # df -k | grep dsk | awk {'print $3'} 2055463 20165785 18310202 32274406 I want to somehow add them up but am no quite sure how to do this in a loop. ...i.e for n in 'df -k | grep dsk | awk {'print $3}' do <some adding... (1 Reply)
Discussion started by: hcclnoodles
1 Replies

10. Programming

adding variables for, for loop

I have a structure which contains n number of elements. For example: stFruits : apple, grapes, strawberry, pear, kiwi, melon, papaya, mango, orange, sweetlime ..... etc Now i have to write a for loop as follows: int i; int j; j=stFruits.apple+stFruits.grapes+stFruits.pear+.... and so... (3 Replies)
Discussion started by: jazz
3 Replies
Login or Register to Ask a Question