Dear Friends,
Can Any one provide me script to generate list of username with the gecos field.
(cat /etc/passwd | cut -d: -f1,5)
Please note i have to run this command from nim server and i have password less ssh access.(ssh hostname command)
and i want a file to be generated on nim server.
Thanks in advance !!:b:
Regards,
Moderator's Comments:
Hi I got a simple question, I want to write a shell script where I input the variable when I execute the script
for example
Code:
./script.sh var1
where it will execute script.sh using var1 as the variable, which is used in the script.
Dear friends,
I have a file with the text:
Code:
href="/archive/ip=x.x.x.x">M</a></td>
I want to extract just the IP number.
Hello friends,
I am new on linux, i am facing issues on below script.
Code:
#!/bin/sh
current=1355147377
echo $current
last_modified=1354537347
echo $last_modified
DIFF='expr ($current - $last_modified)'
echo $DIFF
Moderator's Comments:
Please view this code tag video for how to use c
I have the below code for ftping a file
Code:
sftp "ogl@serverna,me"ogl@serverna,me <<EOF
cd $path_on_the_server
binary
put $path_on_my_sever/filename.txt
bye
EOF
Not sure is this works.but when i tried its asking for password .How i can avoid asking password and provide it in the script.Please let me know.
Moderator's Comments:
Hi
I wrote shell script to do the flowing count from 5 and down but doesn’t work please see my program
Code:
#Bash
x=0
y=10
while (( x < y ))
do
(( x = x + 1 ))
grep -A $x 5 numbers >>file4.txt
done
these the output
Code:
5
6
5
6
7
5
6
7
8
5
6
7
8
9
5
6
7
8
9
10
5
6
7
8
9
10
5
6
7
8
9
10
Moderator's Comments:
Dear ALL,
How to remove junk charecter ^M from unix file i am using sun solaris unix.
I already tried few commands
Code:
:%s/^M//g
:%s/r//g
but it didnt helped me.
Any help appriciated.
Thanks
Ripudaman
Moderator's Comments:
Please view this code tag video for how to use code tags wh
Hi,
How to pass parameter to run folloing script?
Code:
#parameters are div, dept, style
U run_convert_pdm.ksh Mens 44 7542
U run_convert_pdm.ksh "Mens Knit" 44 7541
The first command works fine but the second needs to two words together , it does not work even if
I have have used double quotes.
Thanks
Sandy
Moderator's Comments:
Hi,
I have a csh script. I want to set some variables and execute some command from a file in that script.
abc.csh
Code:
echo "primary script"
b
Code:
setenv XXX ddd
set XX
make abc
I want to execute the commands of "b" file from abc.csh.