Sponsored Content
Top Forums Shell Programming and Scripting Simple script? First timer... Post 302201263 by mschwage on Sunday 1st of June 2008 04:01:25 PM
Old 06-01-2008
Not sure what's wrong- I don't use screen much myself- but I notice a couple of bugs in your code.

First, if you want to use bash call it as bash and not sh. Bash does things to make it more sh-like if you call it as sh.

Next, you have some errors that will not allow your code to work even if screen does what you want it to do. Your code should look like this:
Code:
#!/bin/sh
me=`whoami`
screen -S $me
/bin/bash

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

script run timer

any of you guys have a script for measuring the run time of any given script, where you would sandwich your own script between the timer script or something? thanks! :) (2 Replies)
Discussion started by: mark_nsx
2 Replies

2. Shell Programming and Scripting

Timer

Is there a way to make a timer? E.g Please give the seconds... ... (6 Replies)
Discussion started by: aekaramg20
6 Replies

3. Shell Programming and Scripting

Startup Script "run process with Timer"

Hi I have a script that execute every X minute for checking new files in a folder and converting to pdf. Is there any way to start this script automatically on linux startup?. I use sleep function in script with infinite loop. while do killall -u `whoami` -q soffice soffice... (0 Replies)
Discussion started by: zawmn83
0 Replies

4. UNIX for Dummies Questions & Answers

Timer

is there a timer function in unix without using C? for example i want to display a message after 5 seconds how do i do that? (2 Replies)
Discussion started by: khestoi
2 Replies

5. Shell Programming and Scripting

60 second Timer with Shell Script

Please how can i display a 60 second active countdown timer in an echo message. (7 Replies)
Discussion started by: frankycool
7 Replies

6. Shell Programming and Scripting

Perl script timer on program launch

So I am attempting to get a short but complex perl script to be able to time out an application that I will launch from a command line. The terminal I use is MKS C SHELL and I am having trouble doing the a job spawn that will launch the application and keep time on it. I know you could do this... (1 Reply)
Discussion started by: vas28r13
1 Replies

7. UNIX for Dummies Questions & Answers

Shell Script / Timer

Hey folks, We already got a working Script running, but actually we gotta start it manually but at least we want to run it like every 30minutes 1time. Could anyone give it a shot? #!/bin/sh for i in A B C D E F G H I J K L M N O P Q R S T U V W X Z do ln -sv /x/$i/*/PDF/001-*.*... (1 Reply)
Discussion started by: Yjerith
1 Replies

8. Shell Programming and Scripting

Help making simple perl or bash script to create a simple matrix

Hello all! This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician. Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix: ... (16 Replies)
Discussion started by: torchij
16 Replies

9. Shell Programming and Scripting

Looping in the shell script with help of script timer.

Hello Experts- We are facing some issues in the while loop script when we use the script time to decide whether to exist from the loop or continue. Below is the script SrcExitLoop="FALSE" Src_InitialStartTime=`date +%s` Src_StartTime=`date +%s` Src_NUM_ALERTS=0 TOTAL_ALERTS=`expr <SOME... (4 Replies)
Discussion started by: Amey Joshi
4 Replies

10. UNIX for Dummies Questions & Answers

Help please with FTP timer script

Hi Could somebody please help me with this code? ------------------------------------------ @ftp -i -s:"%~f0"&GOTO:EOF open mysite.co.uk myusername mypassword !:--- FTP commands below here --- cd public_html/ binary lcd c:\ put myfile.jpg bye ... (3 Replies)
Discussion started by: dobbies
3 Replies
getusershell(3C)					   Standard C Library Functions 					  getusershell(3C)

NAME
getusershell, setusershell, endusershell - get legal user shells SYNOPSIS
#include <unistd.h> char *getusershell(void); void setusershell(void); void endusershell(void); DESCRIPTION
The getusershell() function returns a pointer to a legal user shell as defined by the system manager in the file /etc/shells. If /etc/shells does not exist, the following locations of the standard system shells are used in its place: /bin/bash /bin/csh /bin/jsh /bin/ksh /bin/pfcsh /bin/pfksh /bin/pfsh /bin/sh /bin/tcsh /bin/zsh /sbin/jsh /sbin/pfsh /sbin/sh /usr/bin/bash /usr/bin/csh /usr/bin/jsh /usr/bin/ksh /usr/bin/pfcsh /usr/bin/pfksh /usr/bin/pfsh /usr/bin/sh /usr/bin/tcsh /usr/bin/zsh /usr/xpg4/bin/sh The getusershell() function opens the file /etc/shells, if it exists, and returns the next entry in the list of shells. The setusershell() function rewinds the file or the list. The endusershell() function closes the file, frees any memory used by getusershell() and setusershell(), and rewinds the file /etc/shells. RETURN VALUES
The getusershell() function returns a null pointer on EOF. BUGS
All information is contained in memory that may be freed with a call to endusershell(), so it must be copied if it is to be saved. SunOS 5.10 30 Aug 2004 getusershell(3C)
All times are GMT -4. The time now is 07:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy