Search Results

Search: Posts Made By: rockysfr
15,573
Posted By rockysfr
mailx: concatenating strings for message body (KSH)
Hi all,

Think this is a pretty simple problem, but I've been thinking about it for a few days. Let's say that I'm going to have to output the contents of a file as the body of a mailx message.
...
8,289
Posted By rockysfr
Sudoer file - controlling parameters
Greetings all,

I'm interested in knowing more about setting up the sudoers file... hope to receive some advice here.

Let's say that I have 3 users, with usernames user1, user2 and user3. The...
5,362
Posted By rockysfr
Need help with command to append strings
Greetings all,

I'm in need of some help in coming up with this command which requires me to append 5 strings together:

1. echo "Status from system:"
2. `cat logs.txt` (i need the output of...
4,308
Posted By rockysfr
How to restrict the number of commands user can execute
Hi all,

Is there a way to prevent users from being able to execute commands less a select few? For instance, I wish to allow the user to be only able to execute 1 command, which is exec a.sh. He...
53,169
Posted By rockysfr
How to check if a user belongs to a group (KSH)?
Hi all,

How can I check if a particular user id belongs to a group?

(ie. how to check if the current user `whoami` is part of the a certain group? do i use the group name of group id?)
...
3,911
Posted By rockysfr
Cannot read variables after ssh with rc file (KSH)
Greetings all,

I'm currently making use of the $HOME/.ssh/rc file to launch an automated shell script immediately after the user has been verified through ssh.

The current problem that I'm...
7,671
Posted By rockysfr
Can we launch a shell script automatically upon ssh login?
Greetings all,

I'll just like to know if it is possible to launch a shell script automatically upon a user's successful login into ssh from a remote host, without adding a command parameter to the...
30,836
Posted By rockysfr
Hi, Seems like I've been looking into the...
Hi,

Seems like I've been looking into the wrong things... my apologies on that. Here's a description of the real deal:

Consider having a line which resembles this in your script file:

ssh...
30,836
Posted By rockysfr
Hmm... care to show some examples? I'm using...
Hmm... care to show some examples?

I'm using more in the command more "$rootdir/batchfile.log", so is this syntax correct within ssh, or must I add more quotes?
30,836
Posted By rockysfr
Alright, managed to fix the TERM environment...
Alright, managed to fix the TERM environment bug...

Add the following as the 1st 3 lines of your script

#!/bin/ksh
TERM=xterm
export TERM

However, I'm still puzzled as to why the "more"...
30,836
Posted By rockysfr
It's alright to have ssh in interactive mode,...
It's alright to have ssh in interactive mode, though I'm running into some environment trouble after ssh-ing into the shell...

Seems like I'm getting the message "TERM environment variable not...
30,836
Posted By rockysfr
ssh into a shell script (KSH)
Hi all,

Just like to ask if it is possible to do the following:

1. Have a shell script that calls ssh username@destinationhost
2. Upon successful verification, we ssh into the destination host...
4,320
Posted By rockysfr
Hey, thanks a bunch guys! Wouldn't have foreseen...
Hey, thanks a bunch guys! Wouldn't have foreseen this since I'm more of a Java and C programmer than a shell scripter :)
4,320
Posted By rockysfr
Strange parameter passing problems (KSH)
Hi all,

I'm having a rather peculiar problem involving parameter passing with declared functions in my shell script. Hope to get some advice here.

A brief description of my code is as follows:...
4,897
Posted By rockysfr
Use of sudoer with ssh login shell script (KSH)
Greetings all,

I'm in the midst of writing a login component for a series of shell scripts. What my login script does is this:

1. Prompt for username and read in username
2. Prompt for...
21,817
Posted By rockysfr
Mailx in shell script (KSH)
Greetings all,

I'm pretty new to the use of mailx, having been using mutt most of the time. I'm interested to know how I can use mailx within a shell script to send out a formatted email with the...
2,946
Posted By rockysfr
Need help in string filtering (KSH)
Hi all,

I'm interested in printing out only the prefix of a formatted set of filenames. All files of this type have the same 8 character suffix. I'm using KSH.

Is there a command I could use to...
4,987
Posted By rockysfr
Suppose that I want to allow the user to have a...
Suppose that I want to allow the user to have a choice between:

1. Terminating the shell completely
2. Or closing the subshell and going back to the previous shell script that called it.

How...
13,489
Posted By rockysfr
How to reference a variable within sed?
Hi all,

How can I use sed to perform a substitution if the string that I'm going to substitute is stored in a variable:

Let's say:

sed 's/abcdefg/good'

VS

tmp="abcdefg"
sed...
4,987
Posted By rockysfr
Thanks a lot!
Thanks a lot!
4,987
Posted By rockysfr
Killing parent shells from subshells (KSH)
Hi all,

I have a shell script which calls other shell scripts, depending on the input.

Within a.sh, I have a command which calls b.sh (ie. ksh b.sh)

Normally, we use the exit function to...
11,989
Posted By rockysfr
Shell Script Menus - Rejecting invalid input (KSH)
Greetings all,

I'm currently writing a shell script menu which is dynamically populated from an array. Have a question to ask about the filtering of invalid input. I'm using KSH.

A brief...
2,190
Posted By rockysfr
Thanks all!
Thanks all!
2,190
Posted By rockysfr
Tokenising into array (KSH)
Greetings all,

I've been getting a little frustrated over my scripts as I'm not too experienced with powerful commands such as awk and sed. Hope to find some guidance here.

I need to extract...
Showing results 1 to 24 of 24

 
All times are GMT -4. The time now is 04:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy