10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Given a csv file with 40 columns with name, address, hometown etc.
I use a bash command in 1 line which:
1. gets the address column and pipes that to
2. grep the first digit and everything that follows
Command:
awk -F ";" '{print $19}' /Users/jb/Desktop/ReorderTempTotal.csv | grep -o "\d.*"... (7 Replies)
Discussion started by: JBVeenstra
7 Replies
2. Shell Programming and Scripting
Hi,
I am simply trying to check if the variable is empty in the code below but it isn;t working. Anything that I might have missed here
#Check if values in job card are not empty
title=`cat $filename | grep "TITLE:" | cut -d ":" -f3`
if ]
then
echo "10:Title Empty" ":Fail">> $rptfile... (13 Replies)
Discussion started by: nua7
13 Replies
3. Shell Programming and Scripting
Hello
So i have that script collection, in which i have a single script to create a configuration file.
In there, i have multiple occourences of something like this:
prj_title=$(tui-read "What is the TITLE? ($prj_name):")
] && prj_title="${prj_name/_/ }"
They all work as expected, if... (5 Replies)
Discussion started by: sea
5 Replies
4. Shell Programming and Scripting
hi,
i want to check whether a a variable contains some value or is empty in a shell script. so if the variable contains some value i want to do some job and if the variable doesnt contain any value then i need to skip that job.
here is a sample script
read_filenames.sh contains
... (5 Replies)
Discussion started by: Little
5 Replies
5. Shell Programming and Scripting
I am reading from a file and executing the jobs with/without parameters as the job requires.
File
job1 R
job2
job3 Y 123
if
then
<job>.ksh
else
<job>.ksh $params
fi
This works fine if the line read from the file has parameters
it executes like job1.ksh R
But for... (2 Replies)
Discussion started by: nw2unx123
2 Replies
6. Shell Programming and Scripting
Hi All,
I have file with only one record,always be only one record. as like below.
if that line contains newline end of the line..no need to add, if not just add the new line character.
END OF FILE. ROW COUNT: 7
Please help me..
Thanks, (9 Replies)
Discussion started by: bmk
9 Replies
7. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
1.pls tell me the command for checking whether a given directory is empty or not .
2. can i check what is the... (1 Reply)
Discussion started by: upvan111
1 Replies
8. UNIX for Dummies Questions & Answers
variable="unix\nlinux"
echo $variable
expected output:
unix
linux
:wall: can i do that ??
thanks in advance!! (3 Replies)
Discussion started by: sathish92
3 Replies
9. Shell Programming and Scripting
How to check the variable is empty or not?
aaa=" "
how to check aaa variable is empty or just spacing?
If only spacing inside.. it will asume it is empty.
some are 6 spacing, or 8 spacing.. as long as variable is empty with spacing..
anyone can help me? (2 Replies)
Discussion started by: ryanW
2 Replies
10. Shell Programming and Scripting
I need to check if $1 or $2 are empty before continuing but I don't know if bash has any logic of the sort. This is what I'm looking for - except that "and" doesn't seem to work.
if and ;then
...
Thank you! :D (4 Replies)
Discussion started by: ph0enix
4 Replies