10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I have a below syntax its working fine...
var12=$(ps -ef | grep apache | awk '{print $2,$4}')
Im getting expected output as below:
printf "%b\n" "${VAR12}"
dell 123
dell 456
dell 457
Now I wrote a while loop.. the output of VAR12 should be passed as input parameters to while loop and results... (5 Replies)
Discussion started by: sam@sam
5 Replies
2. Shell Programming and Scripting
My script below seems to be choking because I need the the output of the find command to be stored as a variable that can then be called by used lower in the script.
#!/bin/bash
cd "/resumes_to_be_completed"
var1=find . -mmin -1 -type f \( -name "*.doc" -o -name "*.docx" \)... (1 Reply)
Discussion started by: binary-ninja
1 Replies
3. UNIX for Dummies Questions & Answers
Hi,
ps -ef|awk '{print $2}'
i want to store the result of the above command in a variable.
I never worked with arrays in shell scripting.
i tried the below code:
set a=`ps -ef|awk '{print $2}'`
But echo $a returns null.
I want to store the content in a variable and retrieve it... (2 Replies)
Discussion started by: pandeesh
2 Replies
4. Shell Programming and Scripting
Hi,
I have a ftp script there I want to store the o/p of the below command:
sftp -b <batch file> user@password
cat <batch file>
get /remote/file/path/remote_file_name.csv*.gz /local/path
Now the problem is that when I fire this command. Then it gives o/p as:
File... (7 Replies)
Discussion started by: dips_ag
7 Replies
5. Shell Programming and Scripting
Hi all,
I m new to this forum.
I ma facing onei issue.
I have something like this:
length= wc -l < b2| awk '{print $1}'
where b2 is filename having detauls like:
cat b2
abc1
abc4
xyc3
sbdghf4
but when I do echo "$length" it displays nothing
Also I am using awk to overcome... (4 Replies)
Discussion started by: student2009
4 Replies
6. Shell Programming and Scripting
Hi Everyone,
I have a code which requires to be stored in different variables and I am achiving it like this.
HOST=`echo $RMP | cut -f2 -d:`
NAME=`echo $RMP | cut -f3 -d:`
DIR=`echo $RMP | cut -f4 -d:`
TYPE=`echo $RMP | cut -f5 -d:`
Is there any other way of storing value... (2 Replies)
Discussion started by: gehlnar
2 Replies
7. UNIX Desktop Questions & Answers
Hi,
i have some files in one directory(say some sample dir) whose names will be like the following.
some_file1.txt
some_file2.txt.
i need to get the last modified file size based on file name pattern like some_
here i am able to get the value of the last modified file size using the... (5 Replies)
Discussion started by: eswarreddya
5 Replies
8. Shell Programming and Scripting
Hi,
When i execute the below statement , the value is not getting stored in the variable.
AnneeExercice=`sqlplus $LOGSQL/$PASSWORDSQL << FIN >> $GEMOLOG/gemo_reprev_reel_data_ventil_$filiale.trc
SELECT bi09exercice
FROM bi09_scenario
WHERE bi09idfiliale=UPPER('de')
AND ... (1 Reply)
Discussion started by: krishna_gnv
1 Replies
9. Shell Programming and Scripting
I'm writing a bash shell script to backup several mysql databases. This script will run on a daily basis and send a copy to a remote FTP repository. The filenames are in the format DATE.backup.sql. How do I store the DATE variable so I can delete/move/etc the file on the FTP server the next time... (4 Replies)
Discussion started by: hoover90
4 Replies
10. Shell Programming and Scripting
i have this SSH command which runs perfectly on command prompt in sunOS
ssh -o Port=${portno} ${uname}@${server} find ${dir_path} -name '***'
output : /usr/local/home/***
My problem is when i run same command in my script
#!/usr/bin/ksh
res=`ssh -o Port=${portno} ${uname}@${server}... (1 Reply)
Discussion started by: prash184u
1 Replies