10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm working on a script in which gives certain details in its output depending on user-specified options. So, what I'd like to do is something like:
if
then
awkcmd='some_awk_command'
else
awkcmd='some_other_awk_command'
fi
Then, later in the script, we'd do something like:
... (5 Replies)
Discussion started by: treesloth
5 Replies
2. Shell Programming and Scripting
Hi,
My aim is to get the md5 hash of a file and store it in a variable.
var1="md5sum file1"
$var1
The above outputs fine but also contains the filename, so somthing like this 243ASsf25 file1
i just need to get the first part and put it into a variable.
var1="md5sum file1"... (5 Replies)
Discussion started by: JustALol
5 Replies
3. Shell Programming and Scripting
Hi,
I have the following command that lists all the .o files from all the directories except of vwin (which I don't want it)
for i in `ls -d */*.o|awk '$0 !~ "vwin"'`; do echo $i; done
The result is something like that
dir1/file1.o
dir1/file2.o
dir2/file3.o
etc.
So, I want to create a... (9 Replies)
Discussion started by: scor6800
9 Replies
4. Windows & DOS: Issues & Discussions
Hi all,
Is there a simple way to read a command output as a variable? I've running a batch file to do:
attrib.exe * | find /c /v "" >filecount.txt
but rather than write it to the txt file I'd like to read the total in as a variable to pass to the rest of the bat file...
Any help much... (1 Reply)
Discussion started by: Grueben
1 Replies
5. Shell Programming and Scripting
Hi!
i'm trying to parse textfiles against a pattern and storing the result in a variable.
The strings i want to get are embraced by and can occur several times in one line, so e.g.
some text anything else endwhat i have so far:
#!/bin/bash
for f in $*
do
exec 3<&0
exec 0<$f
... (2 Replies)
Discussion started by: thoni
2 Replies
6. 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
7. Programming
The following program takes two command line arguments.
I want the second argument (fileCount) to be stored/printed as a int value. I tried my best to typecast the char to int (check the printf statement at last) but is not working...the output is some junk value.
This program is in its... (3 Replies)
Discussion started by: frozensmilz
3 Replies
8. Shell Programming and Scripting
how would i go about storing this command in a variable
echo "$LINE" | awk -F"|" '{print $1"|"$2"|"$3"}'
i have tried FOO = ${command up there} but receive the error FOO: not found
aswell as a couple of other attempt but no luck (2 Replies)
Discussion started by: nookie
2 Replies
9. Shell Programming and Scripting
Hi All,
Command: grep -i -n "rule" *.err *.log | grep -v "SP_RULE"
The above command when run gives me two -three lines of output.
Now I am storing the result of the grep command
ie,
ruleerrors=`grep -i -n "rule" *.err *.log | grep -v "SP_RULE"`
Now when I echo the value of ruleerrors, I... (6 Replies)
Discussion started by: Sreejith_VK
6 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