i was able to get things working properly.. my issue ended up being more with the SSH and sudo interactions and when i needed to use the -t and when i needed to use -Tt.. For some commands, i had to pull them out and move them into their own ssh connection (ie passwd)
In looking at your suggestions, i also was able to get rid of a lot of unneeded testing that i was doing in my script.
I think i have been able to clean up at least 100 lines of unneeded code with your pointer..
so just wanted to say thx!
---------- Post updated at 03:12 PM ---------- Previous update was at 02:57 PM ----------
1 last quick question.. as part of one of my scripts, i am creating the user account.. How do i need to surround the $5 in the bottom code box below in order for it to display the whole comment field? Previously, when using all my numerous ssh calls, i had been using
Currently as it sits below, for a comment field that contains "test user" i am only getting test as the comment.. i have tried numerous variations of ", and ' with no luck
When you ssh, one layer of quotes gets stripped out. ssh username@host echo "stuff in quotes" becomes echo stuff in quotes. You have to add in literal quote characters to preserve quotes.
hmmm.. i'm still having issues with that last piece.. could you show me what i am doing wrong in this code? The issue is with the $5 part of the useradd command.. (i added some echo tests at the top to try to help figure out the errors of my ways, and snipped out some case statements for berevity)
i had added the echo testers and as it sits when using a comment field containing "test user", my current output in /tmp/testuser is
and below is how the script for this particular command looks when running it with set -x
thanks again! you have been extremely helpful!
Hello,
I need some help from unix guru's here..I am looking for some advanced level script to cleanup the directories and files from specific directories under a file system..
The folders are created under /opt/modules
And under modules, there are multiple subfolders with the application... (6 Replies)
I have a server running redhat 5.5 and it has one SAN device presented to it as LUN9. How can I clean up the remaining entries. I cannot afford to interupt the service. Please assist.
# multipath -l
mpath0 (36000097000019260298953666633436) dm-11 EMC,SYMMETRIX
\_ round-robin 0
\_ 2:0:0:9 ... (2 Replies)
I needed some help with a script to fetch and delete all records prior to 3 days from now connecting to sybase from sunos. I wrote the following script but not working..can someone please guide me with my code.
Thanks
#!/bin/ksh
##GET PREVIOUS DAY DATE
dt=`date | awk... (3 Replies)
Hi,
I am trying to clean up data between parenthesis () in a file.
See example below....
Input File :
(New York) Chicago (London)
New York (Chicago) London
New York Chicago (London)
(New York) (Chicago) (London)
New York (Chicago)
... (3 Replies)
Hi All,
I have this script for linux on cleaning up orphaned folder. But I need to use this on solaris 8/9/10
for user in $(ls | grep -v lost+found) ; do
id $user >/dev/null 2>&1
if ]
then
ls -ld $user
grep $user /etc/passwd
fi
done
Can someone please convert this script? ... (1 Reply)
Hi!
I would like to write a script which remove some files, all beginning with the same prefix :
prefix.1
doc/prefix.2
../prefix.3
etc.
So, I would create a file and chmod it executable. But I dont know how to pass a variable to a script. I would like to write something like
... (2 Replies)
I am trying to add a unique string to a variable to prevent some name space collisions.
DATAFILE=/u001/app/unica/affinium644/campaign/partitions/limited/tmp/ebf9aaah.t~#
DATETIME=`date +%Y%m%d_%H%M%S`
echo $DATAFILE > tmpnme.txt
sed 's_/_ _g' tmpnme.txt > tmpnme2.txt
DATA=$(cat tmpnme2.txt)... (2 Replies)
Is there any facility to filter/identify the data calls and voice calls coming throug modem?
OR
Can we get the data or voice calls information through a script(preferably C Kermit)? (0 Replies)
Hello
I have many old IDs on my AIX and would like to know the
simplest way of knowing the last time an ID was used.
I am familiar with the "last" command.
Thanks for any info :) (1 Reply)